On 12/05/2012 08:34 AM, Akim Demaille wrote: > Hi friends, > > I can't compile Bison with GCC 4.3 and 4.4 (newer ones seem to > be happy, I have not tried to understand why).
You may be hitting some of the problems with 'inline' that Paul has recently been trying to fix, coupled with features lacking in older gcc. > > The attached patch fixes the issue. I'm not sure if your patch is needed. Remember, newer gcc understands '#pragma GCC diagnostic push', but gcc 4.4 does not. I have previously raised the issue, but the consensus at the time was that you should not be enabling -Werror when using older gcc, and that this particular warning set (-Wmissing-prototypes and -Wmissing-declarations) is best silenced via pragma rather than duplicated declarations. What I have instead done in libvirt to allow compilation with older gcc is the following: # Gnulib uses '#pragma GCC diagnostic push' to silence some # warnings, but older gcc doesn't support this. AC_CACHE_CHECK([whether pragma GCC diagnostic push works], [lv_cv_gcc_pragma_push_works], [ save_CFLAGS=$CFLAGS CFLAGS='-Wunknown-pragmas -Werror' AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #pragma GCC diagnostic push #pragma GCC diagnostic pop ]])], [lv_cv_gcc_pragma_push_works=yes], [lv_cv_gcc_pragma_push_works=no]) CFLAGS=$save_CFLAGS]) if test $lv_cv_gcc_pragma_push_works = no; then dontwarn="$dontwarn -Wmissing-prototypes" dontwarn="$dontwarn -Wmissing-declarations" fi -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature