Re: [Spice-devel] [PATCH] m4: Update manywarnings from gnulib
Pushed to spice and spice-gtk On Thu, Oct 02, 2014 at 06:17:53PM +0200, Fabiano FidĂȘncio wrote: From: Cole Robinson crobi...@redhat.com Fixes these noisy errors on Fedora 21: gcc: warning: switch '-Wmudflap' is no longer supported --- This patch can be applied in the following projects: - spice - spice-gtk - gtk-vnc --- m4/manywarnings.m4 | 213 ++--- 1 file changed, 137 insertions(+), 76 deletions(-) diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4 index fd0e372..3e6dd21 100644 --- a/m4/manywarnings.m4 +++ b/m4/manywarnings.m4 @@ -1,5 +1,5 @@ -# manywarnings.m4 serial 3 -dnl Copyright (C) 2008-2012 Free Software Foundation, Inc. +# manywarnings.m4 serial 7 +dnl Copyright (C) 2008-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -35,14 +35,12 @@ AC_DEFUN([gl_MANYWARN_COMPLEMENT], # make sure your gcc understands it. AC_DEFUN([gl_MANYWARN_ALL_GCC], [ - dnl First, check if -Wno-missing-field-initializers is needed. - dnl -Wmissing-field-initializers is implied by -W, but that issues - dnl warnings with GCC version before 4.7, for the common idiom - dnl of initializing types on the stack to zero, using { 0, } + dnl First, check for some issues that only occur when combining multiple + dnl gcc warning categories. AC_REQUIRE([AC_PROG_CC]) if test -n $GCC; then -dnl First, check -W -Werror -Wno-missing-field-initializers is supported +dnl Check if -W -Werror -Wno-missing-field-initializers is supported dnl with the current $CC $CFLAGS $CPPFLAGS. AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported]) AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [ @@ -77,108 +75,171 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], ]) AC_MSG_RESULT([$gl_cv_cc_nomfi_needed]) fi + +dnl Next, check if -Werror -Wuninitialized is useful with the +dnl user's choice of $CFLAGS; some versions of gcc warn that it +dnl has no effect if -O is not also used +AC_MSG_CHECKING([whether -Wuninitialized is supported]) +AC_CACHE_VAL([gl_cv_cc_uninitialized_supported], [ + gl_save_CFLAGS=$CFLAGS + CFLAGS=$CFLAGS -Werror -Wuninitialized + AC_COMPILE_IFELSE( +[AC_LANG_PROGRAM([[]], [[]])], +[gl_cv_cc_uninitialized_supported=yes], +[gl_cv_cc_uninitialized_supported=no]) + CFLAGS=$gl_save_CFLAGS]) +AC_MSG_RESULT([$gl_cv_cc_uninitialized_supported]) + fi + # List all gcc warning categories. + # To compare this list to your installed GCC's, run this Bash command: + # + # comm -3 \ + # (sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \ + # (gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort | + # grep -v -x -f ( + # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec)) + gl_manywarn_set= for gl_manywarn_item in \ --Wall \ -W \ --Wformat-y2k \ --Wformat-nonliteral \ --Wformat-security \ --Winit-self \ --Wmissing-include-dirs \ --Wswitch-default \ --Wswitch-enum \ --Wunused \ --Wunknown-pragmas \ --Wstrict-aliasing \ --Wstrict-overflow \ --Wsystem-headers \ --Wfloat-equal \ --Wtraditional \ --Wtraditional-conversion \ --Wdeclaration-after-statement \ --Wundef \ --Wshadow \ --Wunsafe-loop-optimizations \ --Wpointer-arith \ +-Wabi \ +-Waddress \ +-Waggressive-loop-optimizations \ +-Wall \ +-Warray-bounds \ +-Wattributes \ -Wbad-function-cast \ --Wc++-compat \ --Wcast-qual \ --Wcast-align \ --Wwrite-strings \ --Wconversion \ --Wsign-conversion \ --Wlogical-op \ --Waggregate-return \ --Wstrict-prototypes \ --Wold-style-definition \ --Wmissing-prototypes \ --Wmissing-declarations \ --Wmissing-noreturn \ --Wmissing-format-attribute \ --Wpacked \ --Wpadded \ --Wredundant-decls \ --Wnested-externs \ --Wunreachable-code \ --Winline \ --Winvalid-pch \ --Wlong-long \ --Wvla \ --Wvolatile-register-var \ --Wdisabled-optimization \ --Wstack-protector \ --Woverlength-strings \ -Wbuiltin-macro-redefined \ --Wmudflap \ --Wpacked-bitfield-compat \ --Wsync-nand \ -; do -gl_manywarn_set=$gl_manywarn_set $gl_manywarn_item - done - # The following are not documented in the manual but are included in - # output from gcc --help=warnings. - for gl_manywarn_item in \ --Wattributes \ +-Wcast-align \ +-Wchar-subscripts \ +-Wclobbered \ +-Wcomment \ +-Wcomments \ -Wcoverage-mismatch \ --Wmultichar \ --Wunused-macros \ -; do
Re: [Spice-devel] [PATCH] m4: Update manywarnings from gnulib
On Thu, Oct 02, 2014 at 06:17:53PM +0200, Fabiano FidĂȘncio wrote: From: Cole Robinson crobi...@redhat.com Fixes these noisy errors on Fedora 21: gcc: warning: switch '-Wmudflap' is no longer supported Thanks, I've applied this Daniel -- |: http://berrange.com -o-http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :| ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel
[Spice-devel] [PATCH] m4: Update manywarnings from gnulib
From: Cole Robinson crobi...@redhat.com Fixes these noisy errors on Fedora 21: gcc: warning: switch '-Wmudflap' is no longer supported --- This patch can be applied in the following projects: - spice - spice-gtk - gtk-vnc --- m4/manywarnings.m4 | 213 ++--- 1 file changed, 137 insertions(+), 76 deletions(-) diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4 index fd0e372..3e6dd21 100644 --- a/m4/manywarnings.m4 +++ b/m4/manywarnings.m4 @@ -1,5 +1,5 @@ -# manywarnings.m4 serial 3 -dnl Copyright (C) 2008-2012 Free Software Foundation, Inc. +# manywarnings.m4 serial 7 +dnl Copyright (C) 2008-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -35,14 +35,12 @@ AC_DEFUN([gl_MANYWARN_COMPLEMENT], # make sure your gcc understands it. AC_DEFUN([gl_MANYWARN_ALL_GCC], [ - dnl First, check if -Wno-missing-field-initializers is needed. - dnl -Wmissing-field-initializers is implied by -W, but that issues - dnl warnings with GCC version before 4.7, for the common idiom - dnl of initializing types on the stack to zero, using { 0, } + dnl First, check for some issues that only occur when combining multiple + dnl gcc warning categories. AC_REQUIRE([AC_PROG_CC]) if test -n $GCC; then -dnl First, check -W -Werror -Wno-missing-field-initializers is supported +dnl Check if -W -Werror -Wno-missing-field-initializers is supported dnl with the current $CC $CFLAGS $CPPFLAGS. AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported]) AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [ @@ -77,108 +75,171 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], ]) AC_MSG_RESULT([$gl_cv_cc_nomfi_needed]) fi + +dnl Next, check if -Werror -Wuninitialized is useful with the +dnl user's choice of $CFLAGS; some versions of gcc warn that it +dnl has no effect if -O is not also used +AC_MSG_CHECKING([whether -Wuninitialized is supported]) +AC_CACHE_VAL([gl_cv_cc_uninitialized_supported], [ + gl_save_CFLAGS=$CFLAGS + CFLAGS=$CFLAGS -Werror -Wuninitialized + AC_COMPILE_IFELSE( +[AC_LANG_PROGRAM([[]], [[]])], +[gl_cv_cc_uninitialized_supported=yes], +[gl_cv_cc_uninitialized_supported=no]) + CFLAGS=$gl_save_CFLAGS]) +AC_MSG_RESULT([$gl_cv_cc_uninitialized_supported]) + fi + # List all gcc warning categories. + # To compare this list to your installed GCC's, run this Bash command: + # + # comm -3 \ + # (sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \ + # (gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort | + # grep -v -x -f ( + # awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec)) + gl_manywarn_set= for gl_manywarn_item in \ --Wall \ -W \ --Wformat-y2k \ --Wformat-nonliteral \ --Wformat-security \ --Winit-self \ --Wmissing-include-dirs \ --Wswitch-default \ --Wswitch-enum \ --Wunused \ --Wunknown-pragmas \ --Wstrict-aliasing \ --Wstrict-overflow \ --Wsystem-headers \ --Wfloat-equal \ --Wtraditional \ --Wtraditional-conversion \ --Wdeclaration-after-statement \ --Wundef \ --Wshadow \ --Wunsafe-loop-optimizations \ --Wpointer-arith \ +-Wabi \ +-Waddress \ +-Waggressive-loop-optimizations \ +-Wall \ +-Warray-bounds \ +-Wattributes \ -Wbad-function-cast \ --Wc++-compat \ --Wcast-qual \ --Wcast-align \ --Wwrite-strings \ --Wconversion \ --Wsign-conversion \ --Wlogical-op \ --Waggregate-return \ --Wstrict-prototypes \ --Wold-style-definition \ --Wmissing-prototypes \ --Wmissing-declarations \ --Wmissing-noreturn \ --Wmissing-format-attribute \ --Wpacked \ --Wpadded \ --Wredundant-decls \ --Wnested-externs \ --Wunreachable-code \ --Winline \ --Winvalid-pch \ --Wlong-long \ --Wvla \ --Wvolatile-register-var \ --Wdisabled-optimization \ --Wstack-protector \ --Woverlength-strings \ -Wbuiltin-macro-redefined \ --Wmudflap \ --Wpacked-bitfield-compat \ --Wsync-nand \ -; do -gl_manywarn_set=$gl_manywarn_set $gl_manywarn_item - done - # The following are not documented in the manual but are included in - # output from gcc --help=warnings. - for gl_manywarn_item in \ --Wattributes \ +-Wcast-align \ +-Wchar-subscripts \ +-Wclobbered \ +-Wcomment \ +-Wcomments \ -Wcoverage-mismatch \ --Wmultichar \ --Wunused-macros \ -; do -gl_manywarn_set=$gl_manywarn_set $gl_manywarn_item - done - # More warnings from gcc 4.6.2 --help=warnings. - for gl_manywarn_item in \ --Wabi \ -Wcpp \ +-Wdate-time \ -Wdeprecated \ -Wdeprecated-declarations \ +