From: Chris Hanson Date: Fri, 9 Nov 2018 06:46:09 +0000 (-0800) Subject: Merge branch 'master' of git.sv.gnu.org:/srv/git/mit-scheme X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~116 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=bed3841f164a8f67b4175ec8da9e6306e0b11c1c;p=mit-scheme.git Merge branch 'master' of git.sv.gnu.org:/srv/git/mit-scheme --- bed3841f164a8f67b4175ec8da9e6306e0b11c1c diff --cc src/microcode/configure.ac index b69e23bcd,1c4babf26..ff2ab757d --- a/src/microcode/configure.ac +++ b/src/microcode/configure.ac @@@ -202,39 -202,51 +202,54 @@@ if test x"${GCC}" = xyes; the CFLAGS=${SAVED_CFLAGS} LDFLAGS=${SAVED_LDFLAGS} - if test ${enable_debugging} = no; then + if test x"${enable_debugging}" = xno; then CFLAGS="-O3 ${CFLAGS}" else - CFLAGS="-O0 -g -DENABLE_DEBUGGING_TOOLS ${CFLAGS}" + if test x"${enable_debugging}" = xyes; then + CFLAGS="-DENABLE_DEBUGGING_TOOLS ${CFLAGS}" + fi + CFLAGS="-O0 -g ${CFLAGS}" LDFLAGS="${LDFLAGS} -g" fi - CFLAGS="-Wall -Wundef -Wpointer-arith -Winline ${CFLAGS}" - CFLAGS="-Wstrict-prototypes -Wnested-externs -Wredundant-decls ${CFLAGS}" - - 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])]) + CFLAGS_WERROR=-Werror + + for flag in \ + -Wall \ + -Wclobbered \ + -Wempty-body \ + -Wignored-qualifiers \ + -Wimplicit-fallthrough \ + -Winline \ + -Wmissing-field-initializers \ + -Wmissing-parameter-type \ + -Wnested-externs \ + -Wold-style-declaration \ + -Woverride-init \ + -Wpointer-arith \ + -Wredundant-decls \ + -Wshift-negative-value \ + -Wstrict-prototypes \ + -Wtype-limits \ + -Wundef \ + -Wuninitialized \ + -Wunreachable-code \ + -Wwrite-strings \ + \ + -Wno-error=stringop-truncation \ + ; 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 + # -Wmissing-prototypes (requires prototypes for DEFINE_PRIMITIVE) + # -Wstringop-truncation (requires it to not whine about correct use + # of strncpy for buffers that are _not_ null-terminated) fi FOO=`${INSTALL} --help 2> /dev/null | ${FGREP} -e --preserve-timestamps` if test "x${FOO}" != x; then