[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Fix getline name clash
From: |
Grégoire Sutre |
Subject: |
[PATCH] Fix getline name clash |
Date: |
Thu, 23 Sep 2010 13:36:48 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; NetBSD i386; en-US; rv:1.9.1.11) Gecko/20100723 Lightning/1.0b2pre Shredder/3.0.6 |
Hi,
On NetBSD 5, the latest trunk does not build:
$ ./autogen.sh ; ./configure CFLAGS='-std=gnu99' ; gmake
[...]
gcc -DHAVE_CONFIG_H -I. -Wall -W -I./include -DGRUB_UTIL=1
-DGRUB_LIBDIR=\"/usr/local/lib/grub\"
-DLOCALEDIR=\"/usr/local/share/locale\" -DGRUB_MACHINE_PCBIOS=1
-DGRUB_MACHINE=I386_PC -DGRUB_FILE=\"grub-core/script/lexer.c\" -I. -I.
-I. -I. -I./include -I./include -I./grub-core/gnulib
-I./grub-core/gnulib -I./grub-core/lib/libgcrypt_wrap -Wno-undef
-Wno-sign-compare -Wno-unused -Wno-error -Wno-missing-field-initializers
-std=gnu99 -MT grub-core/script/libgrub_a-lexer.o -MD -MP -MF
grub-core/script/.deps-util/libgrub_a-lexer.Tpo -c -o
grub-core/script/libgrub_a-lexer.o `test -f 'grub-core/script/lexer.c'
|| echo './'`grub-core/script/lexer.c
grub-core/script/lexer.c: In function 'grub_script_lexer_yywrap':
grub-core/script/lexer.c:136: error: 'struct grub_lexer_param' has no
member named 'rpl_getline'
grub-core/script/lexer.c:144: error: 'struct grub_lexer_param' has no
member named 'rpl_getline'
grub-core/script/lexer.c: In function 'grub_script_lexer_init':
grub-core/script/lexer.c:222: error: 'struct grub_lexer_param' has no
member named 'rpl_getline'
I believe that this comes from grub-core/gnulib/stdio.in.h, which
contains:
#if @GNULIB_GETLINE@
/* [...] */
# if @REPLACE_GETLINE@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef getline
# define getline rpl_getline
# endif
On my system, both @GNULIB_GETLINE@ and @REPLACE_GETLINE@ get replaced
by 1 in the generated file grub-core/gnulib/stdio.h. This file gets
included in the above compilation command, which leads to a
substitution of `getline' by `rpl_getline' in lexer.c, even for the
accesses to the field `getline' of the struct grub_lexer_param.
The attached patch simply renames this field by `getnewline'.
Grégoire
patch-getline.diff
Description: Text document
- [PATCH] Fix getline name clash,
Grégoire Sutre <=