[Python-bugs-list] compile error in fileobject.c: getline redefined
(PR#389)
M.-A. Lemburg
mal@lemburg.com
Wed, 05 Jul 2000 17:09:52 +0200
calvin@users.sourceforge.net wrote:
>
> Full_Name: Bastian Kleineidam
> Version: 2.0b1 CVS 5.7.2000
> OS: Debian Linux 2.2
> Submission from: earth.cs.uni-sb.de (134.96.252.92)
>
> getline definition on Linux conflicts with the one in fileobject.c:
>
> compile log snippet
> ================================================================
> gcc -g -O2 -I./../Include -I.. -DHAVE_CONFIG_H -c -o fileobject.o
> fileobject.c
> fileobject.c:587: conflicting types for `getline'
> /usr/include/bits/stdio.h:102: previous declaration of `getline'
> make[1]: *** [fileobject.o] Error 1
> make[1]: Leaving directory `/usr/local/src/python/dist/src/Objects'
> make: *** [Objects] Error 2
> ================================================================
>
> bits/stdio.h snippet:
> ================================================================
> # ifdef __USE_GNU
> /* Like `getdelim', but reads up to a newline. */
> __STDIO_INLINE _IO_ssize_t
> getline (char **__lineptr, size_t *__n, FILE *__stream) __THROW
> {
> return __getdelim (__lineptr, __n, '\n', __stream);
> }
> # endif /* GNU */
> ================================================================
Looks like this was introduced by the new #define _GNU_SOURCE
in Python.h.
I'll fix the function name -- it's much too generic anyway.
> Setup.local:
> ================================================================
> readline readline.c -lreadline -ltermcap
> crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
> nis nismodule.c -lnsl # Sun yellow pages -- not everywhere
> termios termios.c # Steen Lumholt's termios module
> resource resource.c # Jeremy Hylton's rlimit interface
> audioop audioop.c # Operations on audio samples
> imageop imageop.c # Operations on images
> SSL=/usr
> socket socketmodule.c \
> -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
> -L$(SSL)/lib -lssl -lcrypto
> GMP=/usr
> mpz mpzmodule.c -I$(GMP)/include -L$(GMP)/lib -lgmp
> linuxaudiodev linuxaudiodev.c
> timing timingmodule.c
> syslog syslogmodule.c # syslog daemon interface
> _curses _cursesmodule.c -lncurses -ltermcap
> gdbm gdbmmodule.c -lgdbm
> #bsddb bsddbmodule.c -ldb
> zlib zlibmodule.c -lz
> ================================================================
>
> System:
> ================================================================
> Debian 2.2 'potato'
> Kernel 2.2.17pre6
> GNU C Library 2.1.3
> ================================================================
>
> _______________________________________________
> Python-bugs-list maillist - Python-bugs-list@python.org
> http://www.python.org/mailman/listinfo/python-bugs-list
--
Marc-Andre Lemburg
______________________________________________________________________
Business: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/