Warnings that make sense under newer gcc can cause spurious failures under older gcc; it's nice to allow out-of-the-box development on stable releases while still getting the benefit of improved warning detection in bleeding-edge setups.
* configure.ac (nw): Disable gcc warnings that cause build failures under RHEL 6.3. * gnulib: Update to latest. Signed-off-by: Eric Blake <ebl...@redhat.com> --- ChangeLog | 7 +++++++ configure.ac | 23 ++++++++++++++++++++++- gnulib | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b369e83..c415f70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-11-19 Eric Blake <ebl...@redhat.com> + + build: avoid problematic gcc 4.4 warnings + * configure.ac (nw): Disable gcc warnings that cause build + failures under RHEL 6.3. + * gnulib: Update to latest. + 2012-11-14 Paul Eggert <egg...@cs.ucla.edu> doc: improve prehistory discussion diff --git a/configure.ac b/configure.ac index e986de2..2d7ceef 100644 --- a/configure.ac +++ b/configure.ac @@ -75,6 +75,7 @@ if test "$gl_gcc_warnings" = yes; then [M4_cv_gcc_pragma_push_works=no]) CFLAGS=$save_CFLAGS]) + # This, $nw, is the list of warnings we disable. nw= nw="$nw -Waggregate-return" # K&R is anachronistic nw="$nw -Wtraditional-conversion" # K&R is anachronistic @@ -87,7 +88,27 @@ if test "$gl_gcc_warnings" = yes; then nw="$nw -Wsign-conversion" # Too many warnings for now nw="$nw -Wcast-qual" # Too many warnings for now nw="$nw -Wswitch-enum" # Too many warnings for now - # This, $nw, is the list of warnings we disable. + # gcc 4.4.6 complains enum-compare is C++ only; gcc 4.7.0 implies it in -Wall + nw="$nw -Wenum-compare" + + # 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], + [M4_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 + ]])], + [M4_cv_gcc_pragma_push_works=yes], + [M4_cv_gcc_pragma_push_works=no]) + CFLAGS=$save_CFLAGS]) + if test $M4_cv_gcc_pragma_push_works = no; then + nw="$nw -Wmissing-prototypes" + nw="$nw -Wmissing-declarations" + nw="$nw -Wunreachable-code" + fi gl_MANYWARN_ALL_GCC([ws]) gl_MANYWARN_COMPLEMENT([ws], [$ws], [$nw]) diff --git a/gnulib b/gnulib index 3a9002d..fd9f1ac 160000 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit 3a9002d3cc63da7110f133b1040d2d2b0aad8305 +Subproject commit fd9f1acededd74f8cd095e657528aa8fad183536 -- 1.7.11.7 _______________________________________________ M4-patches mailing list M4-patches@gnu.org https://lists.gnu.org/mailman/listinfo/m4-patches