From: Taylor R Campbell Date: Thu, 8 Nov 2018 16:13:32 +0000 (+0000) Subject: Subscribe to particular warning flags, not to -Wextra. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~116^2~7 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=4cfe81189a1728be2b360a2e672f56bb44a5023e;p=mit-scheme.git Subscribe to particular warning flags, not to -Wextra. -Wextra now entails -Wcast-function-type, which is incompatible with various Unix APIs like sigaction. --- diff --git a/src/microcode/configure.ac b/src/microcode/configure.ac index 895bab4c9..300baf74f 100644 --- a/src/microcode/configure.ac +++ b/src/microcode/configure.ac @@ -212,24 +212,27 @@ if test ${GCC} = yes; then CFLAGS="-Wstrict-prototypes -Wnested-externs -Wredundant-decls ${CFLAGS}" CFLAGS_WERROR=-Werror - AC_MSG_CHECKING([for GCC>=4]) - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[ - #if __GNUC__ >= 4 - ; - #else - #error "gcc too old" - #endif - ]], - [[]] - )], - [ - AC_MSG_RESULT([yes]) - CFLAGS="-Wextra -Wno-sign-compare -Wno-unused-parameter ${CFLAGS}" - CFLAGS="-Wold-style-definition ${CFLAGS}" - ], - [AC_MSG_RESULT([no])]) + for flag in \ + -Wclobbered \ + -Wempty-body \ + -Wignored-qualifiers \ + -Wimplicit-fallthrough \ + -Wmissing-field-initializers \ + -Wmissing-parameter-type \ + -Wold-style-declaration \ + -Woverride-init \ + -Wtype-limits \ + -Wuninitialized \ + -Wshift-negative-value \ + ; do + AC_MSG_CHECKING([for compiler warning $flag]) + SAVED_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $flag" + AC_TRY_COMPILE([],[], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + CFLAGS="$SAVED_CFLAGS"]) + done # other possibilities: # -Wmissing-prototypes -Wunreachable-code -Wwrite-strings