# HG changeset patch # User John W. Eaton # Date 1294921306 18000 # Node ID 8837a42205d3eb94718bbfb3ed9a4d7fbc3c527c # Parent f3d0b69c46280e6966ad687c2b07fd0c27481dcb more warning flags for GCC if configured with --enable-extra-warning-flags (on by default) diff -r f3d0b69c4628 -r 8837a42205d3 ChangeLog --- a/ChangeLog Thu Jan 13 06:31:32 2011 -0500 +++ b/ChangeLog Thu Jan 13 07:21:46 2011 -0500 @@ -1,3 +1,10 @@ +2011-01-13 John W. Eaton + + * configure.ac (AC_ARG_ENABLE(extra-warning-flags)): Check for + -Wpointer-arith, -Wmissing-prototypes, -Wstrict-prototypes, and + -Wwrite-strings and add them to WARN_CFLAGS. Check for + -Wpointer-arith and add them to WARN_CXXFLAGS. + 2011-01-12 John W. Eaton * mk-opts.pl: Generate initialization lists and in-line code for diff -r f3d0b69c4628 -r 8837a42205d3 configure.ac --- a/configure.ac Thu Jan 13 06:31:32 2011 -0500 +++ b/configure.ac Thu Jan 13 07:21:46 2011 -0500 @@ -1851,6 +1851,18 @@ OCTAVE_CC_FLAG(-Wformat, [ WARN_CFLAGS="$WARN_CFLAGS -Wformat"; AC_MSG_RESULT([adding -Wformat to WARN_CFLAGS])]) + OCTAVE_CC_FLAG(-Wpointer-arith, [ + WARN_CFLAGS="$WARN_CFLAGS -Wpointer-arith"; + AC_MSG_RESULT([adding -Wpointer-arith to WARN_CFLAGS])]) + OCTAVE_CC_FLAG(-Wmissing-prototypes, [ + WARN_CFLAGS="$WARN_CFLAGS -Wmissing-prototypes"; + AC_MSG_RESULT([adding -Wmissing-prototypes to WARN_CFLAGS])]) + OCTAVE_CC_FLAG(-Wstrict-prototypes, [ + WARN_CFLAGS="$WARN_CFLAGS -Wstrict-prototypes"; + AC_MSG_RESULT([adding -Wstrict-prototypes to WARN_CFLAGS])]) + OCTAVE_CC_FLAG(-Wwrite-strings, [ + WARN_CFLAGS="$WARN_CFLAGS -Wwrite-strings"; + AC_MSG_RESULT([adding -Wwrite-strings to WARN_CFLAGS])]) OCTAVE_CXX_FLAG(-Wall, [ WARN_CXXFLAGS="$WARN_CXXFLAGS -Wall"; @@ -1867,13 +1879,17 @@ OCTAVE_CXX_FLAG(-Wformat, [ WARN_CXXFLAGS="$WARN_CXXFLAGS -Wformat"; AC_MSG_RESULT([adding -Wformat to WARN_CXXFLAGS])]) + OCTAVE_CXX_FLAG(-Wpointer-arith, [ + WARN_CXXFLAGS="$WARN_CXXFLAGS -Wpointer-arith"; + AC_MSG_RESULT([adding -Wpointer-arith to WARN_CXXFLAGS])]) + OCTAVE_CXX_FLAG(-Wwrite-strings, [ + WARN_CXXFLAGS="$WARN_CXXFLAGS -Wwrite-strings"; + AC_MSG_RESULT([adding -Wwrite-strings to WARN_CXXFLAGS])]) fi -GCC_STRICT_FLAGS="-Wcast-align -Wcast-qual -Wconversion -Wmissing-prototypes \ - -Wpointer-arith -Wstrict-prototypes -Wwrite-strings" +GCC_STRICT_FLAGS="-Wcast-align -Wcast-qual -Wconversion" -GXX_STRICT_FLAGS="-Wcast-align -Wcast-qual -Wconversion -Wpointer-arith \ - -Wwrite-strings -Weffc++" +GXX_STRICT_FLAGS="-Wcast-align -Wcast-qual -Wconversion -Weffc++" try_strict_warning_flags=false