public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] openswan compile issue with glibc-2.10
@ 2009-06-01 20:10 Timur Aydin
  2009-06-01 20:26 ` Dawid Węgliński
  2009-06-01 20:27 ` Peter Alfredsen
  0 siblings, 2 replies; 4+ messages in thread
From: Timur Aydin @ 2009-06-01 20:10 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1264 bytes --]

Today I have tried to merge openswan-2.4-14 into my ~x86 system. The 
compilation failed because of a name clash:

cc -I. -I/home/ta/tmp/openswan-2.4.14.orig/linux/net/ipsec 
-I/home/ta/tmp/openswan-2.4.14.orig/linux/include 
-I/home/ta/tmp/openswan-2.4.14.orig -DDEBUG -DWITH_UDPFROMTO 
-DHAVE_IP_PKTINFO -I/home/ta/tmp/openswan-2.4.14.orig/include -g -O3 
-DDISABLE_UDP_CHECKSUM -Wall -Wpointer-arith -Wcast-qual 
-Wstrict-prototypes -Wbad-function-cast  -DNAT_TRAVERSAL   -c -o 
optionsfrom.o optionsfrom.c
optionsfrom.c:34: error: conflicting types for 'getline'
/usr/include/stdio.h:651: error: previous declaration of 'getline' was here
make[2]: *** [optionsfrom.o] Error 1
make[2]: Leaving directory 
`/home/ta/tmp/openswan-2.4.14.orig/lib/libopenswan'
make[1]: *** [programs] Error 1
make[1]: Leaving directory `/home/ta/tmp/openswan-2.4.14.orig/lib'
make: *** [programs] Error 1

The getline function is implemented in the optionsfrom.c source file in 
the openswan distribution. But the same function is implemented in glibc 
as well, but has a different signature and return code. It seems it is 
best to rename the getline function to something else to resolve this. 
Attached is a patch that renames all insances of getline to osw_getline.

-- 
Timur

[-- Attachment #2: openswan-2.4.14-getline.patch --]
[-- Type: text/plain, Size: 1564 bytes --]

diff -Nru openswan-2.4.14.orig/lib/libopenswan/optionsfrom.c openswan-2.4.14/lib/libopenswan/optionsfrom.c
--- openswan-2.4.14.orig/lib/libopenswan/optionsfrom.c	2004-04-09 21:00:38.000000000 +0300
+++ openswan-2.4.14/lib/libopenswan/optionsfrom.c	2009-06-01 22:21:56.000000000 +0300
@@ -31,7 +31,7 @@
 
 static const char *dowork(const char *, int *, char ***, int);
 static const char *getanarg(FILE *, struct work *, char **);
-static char *getline(FILE *, char *, size_t);
+static char *osw_getline(FILE *, char *, size_t);
 
 /*
  - optionsfrom - add some options, taken from a file, to argc/argv
@@ -149,7 +149,7 @@
 	char *endp;
 
 	while (w->pending == NULL) {	/* no pending line */
-		if ((w->line = getline(f, w->buf, sizeof(w->buf))) == NULL)
+		if ((w->line = osw_getline(f, w->buf, sizeof(w->buf))) == NULL)
 			return "error in line read";	/* caller checks EOF */
 		if (w->line[0] != '#' &&
 				*(w->line + strspn(w->line, " \t")) != '\0')
@@ -171,7 +171,7 @@
 			if (*linep == NULL)
 				return "out of memory for new line";
 			strcpy(*linep, p);
-		} else			/* getline already malloced it */
+		} else			/* osw_getline already malloced it */
 			*linep = p;
 		return NULL;
 	}
@@ -203,10 +203,10 @@
 }
 
 /*
- - getline - read a line from the file, trim newline off
+ - osw_getline - read a line from the file, trim newline off
  */
 static char *			/* pointer to line, NULL for eof/error */
-getline(f, buf, bufsize)
+osw_getline(f, buf, bufsize)
 FILE *f;
 char *buf;			/* buffer to use, if convenient */
 size_t bufsize;			/* size of buf */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] openswan compile issue with glibc-2.10
  2009-06-01 20:10 [gentoo-dev] openswan compile issue with glibc-2.10 Timur Aydin
@ 2009-06-01 20:26 ` Dawid Węgliński
  2009-06-01 20:27 ` Peter Alfredsen
  1 sibling, 0 replies; 4+ messages in thread
From: Dawid Węgliński @ 2009-06-01 20:26 UTC (permalink / raw
  To: gentoo-dev

On Monday 01 of June 2009 22:10:47 Timur Aydin wrote:
> Today I have tried to merge openswan-2.4-14 into my ~x86 system. The
> compilation failed because of a name clash:
>

Hi Timur.

Mind to report this issue on bugs.gentoo.org with patch attached there? Also 
don't forget to check if the bug wasn't reported before!

-- 
Cheers
Dawid Węgliński



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] openswan compile issue with glibc-2.10
  2009-06-01 20:10 [gentoo-dev] openswan compile issue with glibc-2.10 Timur Aydin
  2009-06-01 20:26 ` Dawid Węgliński
@ 2009-06-01 20:27 ` Peter Alfredsen
  2009-06-02  2:45   ` Timur Aydin
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Alfredsen @ 2009-06-01 20:27 UTC (permalink / raw
  To: gentoo-dev; +Cc: ta

On Mon, 01 Jun 2009 23:10:47 +0300
Timur Aydin <ta@taydin.org> wrote:

> Today I have tried to merge openswan-2.4-14 into my ~x86 system. The 
> compilation failed because of a name clash:

Please attach your patch here:
https://bugs.gentoo.org/show_bug.cgi?id=271987 

We use bugzilla for bug reports.

/loki_val



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-dev] openswan compile issue with glibc-2.10
  2009-06-01 20:27 ` Peter Alfredsen
@ 2009-06-02  2:45   ` Timur Aydin
  0 siblings, 0 replies; 4+ messages in thread
From: Timur Aydin @ 2009-06-02  2:45 UTC (permalink / raw
  To: gentoo-dev

Peter Alfredsen <loki_val@gentoo.org> writes:

> Please attach your patch here:
> https://bugs.gentoo.org/show_bug.cgi?id=271987 
>
> We use bugzilla for bug reports.
>

Done, thank you for providing the link to the existing bug report.

-- 
Timur Aydin



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-06-02  2:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-01 20:10 [gentoo-dev] openswan compile issue with glibc-2.10 Timur Aydin
2009-06-01 20:26 ` Dawid Węgliński
2009-06-01 20:27 ` Peter Alfredsen
2009-06-02  2:45   ` Timur Aydin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox