grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error building grub-emu (gnulib/progname.c)


From: Seth Goldberg
Subject: Re: Error building grub-emu (gnulib/progname.c)
Date: Thu, 2 Dec 2010 17:20:47 -0800 (PST)
User-agent: Alpine 2.00 (GSO 1167 2008-08-23)


Adding:

#if __STDC_VERSION__ >= 199901L
_GL_FUNCDECL_SYS (mempcpy, void *,
                  (void *restrict __dest, void const *restrict __src,
                   size_t __n)
                  _GL_ARG_NONNULL ((1, 2)));
#else
_GL_FUNCDECL_SYS (mempcpy, void *,
                  (void *__dest, void const *__src,
                   size_t __n)
                  _GL_ARG_NONNULL ((1, 2)));
#endif


Seems to get me around it, but it's a bit of a hack (since it doesn't address other declarations in the same file that include restrict) #defining restrict won't work either because the restrict text is inside a parameter to another macro expansion.

 --S

Quoting Seth Goldberg, who wrote the following on Thu, 2 Dec 2010:


Trying that led to a number of other build failures (in grub-core/fs), so this needs to be better thought out.

--S

Quoting Seth Goldberg, who wrote the following on Thu, 2 Dec 2010:

Hi,

While trying to build grub-emu, I hit this:

/usr/gcc/4.3/bin/gcc -DHAVE_CONFIG_H -I. -I../../grub-core -I.. -Wall -W -I../../include -I../include -DGRUB_MACHINE_EMU=1 -DGRUB_MACHINE=I386_EMU -DGRUB_FILE=\"gnulib/progname.c\" -I. -I../../grub-core -I.. -I../.. -I../../include -I../include -I../grub-core/gnulib -I../../grub-core/gnulib -I/usr/sfw/include -Os -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -fno-common -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1 -ffreestanding -fno-common -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -MT gnulib/kernel_exec-progname.o -MD -MP -MF gnulib/.deps-core/kernel_exec-progname.Tpo -c -o gnulib/kernel_exec-progname.o `test -f 'gnulib/progname.c' || echo '../../grub-core/'`gnulib/progname.c
In file included from ../../grub-core/gnulib/progname.c:28:
../grub-core/gnulib/string.h:456: error: expected ‘;’, ‘,’ or ‘)’ before ‘__dest’

The offending line:
_GL_FUNCDECL_SYS (mempcpy, void *,
                 (void *restrict __dest, void const *restrict __src,
                  size_t __n)
                 _GL_ARG_NONNULL ((1, 2)));

uses the restrict keyword, which is not enabled by default with GCC 4.3.3, which I'm using. Adding -std=c99 allowed this to compile. So, a configure test should be added to enable this flag for versions of GCC that we support, but that do not enable c99 keywords by default.

Thanks,
--S

reply via email to

[Prev in Thread] Current Thread [Next in Thread]