Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 32968 - ethereal 0.9.1[3-6] conflicting types / previous declaration of getline
Summary: ethereal 0.9.1[3-6] conflicting types / previous declaration of getline
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major
Assignee: Patrick Kursawe (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-07 13:44 UTC by Hans-Christian Armingeon
Modified: 2003-11-26 00:13 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Christian Armingeon 2003-11-07 13:44:24 UTC
emerge ethereal fails



Reproducible: Always
Steps to Reproduce:
1. emerge ethereal
2.
3.

Actual Results:  
gcc -DHAVE_CONFIG_H -I. -I. -I.   -DINET6 -O3 -march=athlon-xp -fomit-frame-poin
ter -pipe -Dlinux -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-ali
asing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl5/5.8.1/i686-lin
ux-thread-multi/CORE -I. -I/usr/include  -DINET6 -D_U_="__attribute__((unused))"
 -Wall -W -O3 -march=athlon-xp -fomit-frame-pointer -pipe -I. -I./wiretap  -pthr
ead -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/
usr/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/inclu
de/glib-2.0 -I/usr/lib/glib-2.0/include   -DINET6 -O3 -march=athlon-xp -fomit-fr
ame-pointer -pipe -Dlinux -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-st
rict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl5/5.8.1/
i686-linux-thread-multi/CORE -I. -I/usr/include -c `test -f 'packet-giop.c' || e
cho './'`packet-giop.c
packet-giop.c:1272: error: conflicting types for `getline'
/usr/include/bits/stdio.h:103: error: previous declaration of `getline'
make[2]: *** [packet-giop.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/var/tmp/portage/ethereal-0.9.13/work/ethereal-0.9.1
3'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/ethereal-0.9.13/work/ethereal-0.9.1
3'
make: *** [all] Error 2

!!! ERROR: net-analyzer/ethereal-0.9.13 failed.
!!! Function src_compile, Line 67, Exitcode 2
!!! compile problem




Portage 2.0.49-r15 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r8, 2.4.22)
=================================================================
System uname: 2.4.22 i686 mobile AMD Athlon(tm) XP 2500+
Gentoo Base System version 1.4.3.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=athlon-xp -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config
/usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/config"
CONFIG_PROTECT_MASK="/etc/afs/C /etc/afs/afsws /etc/gconf /etc/env.d"
CXXFLAGS="-O3 -march=athlon-xp -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 apm ginac qhull aalib acl acpi afs alsa apache2 arts avi berkdb bonobo
cdr crypt cscope cups curl dga directfb doc dvb dvd emacs encode esd ethereal
evo fbcon firebird flash foomaticdb freetds gb gd gdbm ggi gif gnome gphoto2 gpm
gps gstreamer gtk gtk2 gtkhtml guile imap imlib innodb informix ipv6 jack java
jikes joystick jpeg kde kerberos krb4 ladcca lcm ldap leim libg++ libgda libwww
lirc mad maildir mbox mcal mikmod memlimit mmx motif mozilla mpeg mpi mule mysql
nas ncurses nhc98 nls oci8 odbc oggvorbis opengl oss pam pcmcia pda ppds pdflib
perl plotutils png pnp postgres prelude python qt quicktime readline ruby samba
sasl scanner sdl slang slp snmp socks5 spell ssl svga tcltk tcpd tetex tiff
truetype usb wmf wxwindows X Xaw3d xface xinerama xosd xml2 xmms xv zeo zlib
threads"
Comment 1 Patrick Kursawe (RETIRED) gentoo-dev 2003-11-17 01:41:08 UTC
Could you please try .16?
Comment 2 Patrick Kursawe (RETIRED) gentoo-dev 2003-11-18 23:46:14 UTC
Hans-Christian? Still there?
Comment 3 Hans-Christian Armingeon 2003-11-21 08:58:42 UTC
Sorry for the late reply, I've been busy the last few days.

Well, I'm still there. But the box isn't. It crashed, and killed the ext filesystem. I had some other problems there, and I fixed them by USE=nothing emerge something ; USE=morethannothing emerge anotherpackage , so I think that the package database broke, or something else.

So I installed a new system, and I am running into new troubles... .

Johnny
Comment 4 Hans-Christian Armingeon 2003-11-22 14:06:26 UTC
Well, in my new install, I am running into the same problem with 16:

te__((unused))" -Wall -W -O3 -march=athlon-xp -fomit-frame-pointer -pipe  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -DINET6 -O3 -march=athlon-xp -fomit-frame-pointer -pipe -Dlinux -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl5/5.8.2/i686-linux-thread-multi/CORE -I. -I/usr/include -c `test -f 'packet-gnutella.c' || echo './'`packet-gnutella.c
packet-giop.c:1272: error: conflicting types for `getline'
/usr/include/bits/stdio.h:103: error: previous declaration of `getline'
make[2]: *** [packet-giop.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/var/tmp/portage/ethereal-0.9.16/work/ethereal-0.9.16'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/ethereal-0.9.16/work/ethereal-0.9.16'
make: *** [all] Error 2

!!! ERROR: net-analyzer/ethereal-0.9.16 failed.
!!! Function src_compile, Line 70, Exitcode 2
!!! compile problem
 
emerge  --info

Portage 2.0.49-r15 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.4.20-gentoo-r8)
=================================================================
System uname: 2.4.20-gentoo-r8 i686 mobile AMD Athlon(tm) XP 2500+
Gentoo Base System version 1.4.3.12
distcc 2.11.2 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=athlon-xp -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /lib/modules /usr/X11R6/lib/X11/xkb /usr/kde/3.2/share/config /usr/kde/3.1/share/config /var/lib/postgresql /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/xdvi/ /usr/share/config"
CONFIG_PROTECT_MASK="/etc/afs/C /etc/afs/afsws /etc/gconf /etc/env.d"
CXXFLAGS="-O3 -march=athlon-xp -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 apm ruby ginac qhull aalib acl acpi afs alsa apache2 arts avi berkdb bonobo cdr crypt cscope cups curl dga directfb doc dvb dvd emacs encode esd ethereal evo fbcon firebird flash foomaticdb freetds gb gd gdbm ggi gif gnome gphoto2
gpm gps gstreamer gtk gtk2 gtkhtml guile imap imlib innodb informix ipv6 jack java jikes joystick jpeg kde kerberos krb4 ladcca lcm ldap leim libg++ libgda libwww lirc mad maildir mbox mcal mikmod memlimit mmx motif mozilla mpeg mpi mule mysql nas ncurses nhc98 nls oci8 odbc oggvorbis opengl oss pam pcmcia pda ppds pdflib perl plotutils png pnp postgres prelude python qt quicktime readline ruby18
samba sasl scanner sdl slang slp snmp socks5 spell ssl svga tcltk tcpd tetex tiff truetype usb wmf wxwindows X Xaw3d xface xinerama xosd xml2 xmms xv zeo zlib threads video_cards_radeon linguas_de"
Comment 5 Patrick Kursawe (RETIRED) gentoo-dev 2003-11-24 00:55:28 UTC
Could you please quote a few lines around line 103 of /usr/include/bits/stdio.h ? You have a different glibc version, maybe that's the problem.
Comment 6 Stephane Loeuillet 2003-11-25 04:21:27 UTC
ethereal 0.9.16 here, but latest gcc 3.3.2 and glibc 2.3.2 (~x86)

very same bug, so he's not alone

gcc -DHAVE_CONFIG_H -I. -I. -I.  -I. -I./wiretap -DINET6 -march=athlon-xp -O3 -pipe -fomit-frame-pointer -Dlinux -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl5/5.8.2/i686-linux-thread-multi/CORE -I. -I/usr/include  -DINET6 -D_U_="__attribute__((unused))" -Wall -W -march=athlon-xp -O3 -pipe -fomit-frame-pointer  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -DINET6 -march=athlon-xp -O3 -pipe -fomit-frame-pointer -Dlinux -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl5/5.8.2/i686-linux-thread-multi/CORE -I. -I/usr/include -c `test -f 'packet-giop.c' || echo './'`packet-giop.c
packet-giop.c:1272: error: conflicting types for `getline'
/usr/include/bits/stdio.h:103: error: previous declaration of `getline'

could this be possible gcc keeps an old version of this header somewhere ?

here is my local definition of this function :

extern _IO_ssize_t getline (char **__restrict __lineptr,
			    size_t *__restrict __n,
			    FILE *__restrict __stream);

(/usr/include/stdio.h)

and the way it is defined in bits/stdio.h :

__STDIO_INLINE _IO_ssize_t
getline (char **__lineptr, size_t *__n, FILE *__stream)
{
  return __getdelim (__lineptr, __n, '\n', __stream);
}

could someone that could compile this version of ethereal compare what he has in its headers with this please.

here is the private getline defined in ethereal .c file :

static int getline(FILE *fp, gchar *line, int maxlen) {

  if (fgets(line,maxlen,fp) == NULL)
    return 0;
  else
    return strlen(line);

}

redefining a function that might already be defined is a bad thing.
there are two solutions : test for getline presence (it's a GNU function, not POSIX) and use it if it exists (define private if not available in libc)

or always define it but with a private name like ethereal_getline so that it would never conflict with an existing one.

and could the reporter or assignee change the summary to 0.9.1[3-6]
Comment 7 Patrick Kursawe (RETIRED) gentoo-dev 2003-11-25 07:30:02 UTC
Changed summary, added a quick sed hack as a workaround and reported the problem upstream, pointing at this bug report. Waiting for feedback.

For the impatient:
3c3
< # $Header: /home/cvsroot/gentoo-x86/net-analyzer/ethereal/ethereal-0.9.16.ebuild,v 1.4 2003/11/24 08:29:04 phosphan Exp $
---
> # $Header: /home/cvsroot/gentoo-x86/net-analyzer/ethereal/ethereal-0.9.16.ebuild,v 1.5 2003/11/25 15:26:36 phosphan Exp $
33a34,35
>       # re-declaring functions is no good idea
>       sed -i 's/getline/packet_giop_getline/g' packet-giop.c

Declaring this fixed for now (I hope it is).
Comment 8 Stephane Loeuillet 2003-11-25 08:05:08 UTC
this sed regexp worked like a charm. thanks

0.9.16 built and working
Comment 9 Patrick Kursawe (RETIRED) gentoo-dev 2003-11-26 00:13:32 UTC
Function was renamed upstream, so we should be able to remove this for the next version.