From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Oyk6i-0000zq-8c for mharc-grub-devel@gnu.org; Thu, 23 Sep 2010 07:36:56 -0400 Received: from [140.186.70.92] (port=54189 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oyk6f-0000zi-Sc for grub-devel@gnu.org; Thu, 23 Sep 2010 07:36:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oyk6e-0005sP-Ge for grub-devel@gnu.org; Thu, 23 Sep 2010 07:36:53 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:60409) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oyk6e-0005sF-6v for grub-devel@gnu.org; Thu, 23 Sep 2010 07:36:52 -0400 Received: by wwb24 with SMTP id 24so1618471wwb.30 for ; Thu, 23 Sep 2010 04:36:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type; bh=G4fX+68Lzne0ixzZsPOTPPst43FpHVzYzQ9ww/rNZXk=; b=snQeaPcXO8PVGRclnc3+ywrJY113iGH/8i5wDujAHNV7cPyj4lR3nGt7xDhI5N1mDF h6N7ToQSXJ1S4hdnlvNBoytu0KUfREhLg/5PTpUIlIArFo6OkCDu4aZR/ZJ5YAhlGbFk x1c6DRPV2bVVDvD2N+TO/r0o319OeC/We3A8s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; b=LGPwDrbCIlAHDpYzH07DwZe4Z/XnZxTWyQXup2ts4ojBGa75HG+BqeBX7rXZe7kdSH /lLxKGGVzThuc5iT+nuFfT8zPmju3u5gBeER7aa1y+9WZ+UsQhd+0UEXjcVk3L54mXN6 TkrraiUvMglFo7IAejdLHTHAZWbWmJrAhHdWY= Received: by 10.216.157.72 with SMTP id n50mr8169884wek.4.1285241811297; Thu, 23 Sep 2010 04:36:51 -0700 (PDT) Received: from [147.210.129.4] (laptop-147-210-129-4.labri.fr [147.210.129.4]) by mx.google.com with ESMTPS id k83sm423018weq.14.2010.09.23.04.36.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 23 Sep 2010 04:36:50 -0700 (PDT) Message-ID: <4C9B3BD0.3060108@gmail.com> Date: Thu, 23 Sep 2010 13:36:48 +0200 From: =?ISO-8859-1?Q?Gr=E9goire_Sutre?= 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 MIME-Version: 1.0 To: The development of GRUB 2 Content-Type: multipart/mixed; boundary="------------060908090009060908030407" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [PATCH] Fix getline name clash X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Sep 2010 11:36:55 -0000 This is a multi-part message in MIME format. --------------060908090009060908030407 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit 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 --------------060908090009060908030407 Content-Type: text/plain; name="patch-getline.diff" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="patch-getline.diff" === modified file 'ChangeLog' --- ChangeLog 2010-09-23 00:10:44 +0000 +++ ChangeLog 2010-09-23 11:18:51 +0000 @@ -1,3 +1,10 @@ +2010-09-23 Grégoire Sutre + + * include/grub/script_sh.h (grub_lexer_param): Renamed field `getline' + into `getnewline'. + * grub-core/script/lexer.c (grub_script_lexer_yywrap): Likewise. + (grub_script_lexer_init): Likewise. + 2010-09-23 Vladimir Serbinenko Support xz compression on yeeloong. === modified file 'grub-core/script/lexer.c' --- grub-core/script/lexer.c 2010-09-04 05:26:23 +0000 +++ grub-core/script/lexer.c 2010-09-23 07:32:35 +0000 @@ -133,7 +133,7 @@ grub_script_lexer_yywrap (struct grub_pa if (! lexerstate->refs && ! lexerstate->prefix && ! input) return 1; - if (! lexerstate->getline && ! input) + if (! lexerstate->getnewline && ! input) { grub_script_yyerror (parserstate, "unexpected end of file"); return 1; @@ -141,7 +141,7 @@ grub_script_lexer_yywrap (struct grub_pa line = 0; if (! input) - lexerstate->getline (&line, 1); + lexerstate->getnewline (&line, 1); else line = grub_strdup (input); @@ -219,7 +219,7 @@ grub_script_lexer_init (struct grub_pars return 0; } - lexerstate->getline = getline; /* rest are all zeros already */ + lexerstate->getnewline = getline; /* rest are all zeros already */ if (yylex_init (&lexerstate->yyscanner)) { grub_free (lexerstate->text); === modified file 'include/grub/script_sh.h' --- include/grub/script_sh.h 2010-09-04 17:04:32 +0000 +++ include/grub/script_sh.h 2010-09-23 07:33:42 +0000 @@ -160,7 +160,7 @@ struct grub_lexer_param { /* Function used by the lexer to get a new line when more input is expected, but not available. */ - grub_reader_getline_t getline; + grub_reader_getline_t getnewline; /* A reference counter. If this is >0 it means that the parser expects more tokens and `getline' should be called to fetch more. --------------060908090009060908030407--