changeset 11511:8837a42205d3

more warning flags for GCC if configured with --enable-extra-warning-flags (on by default)
author John W. Eaton <jwe@octave.org>
date Thu, 13 Jan 2011 07:21:46 -0500
parents f3d0b69c4628
children e4e82740e9cd
files ChangeLog configure.ac
diffstat 2 files changed, 27 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-01-13  John W. Eaton  <jwe@octave.org>
+
+	* 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  <jwe@octave.org>
 
 	* mk-opts.pl: Generate initialization lists and in-line code for
--- a/configure.ac
+++ b/configure.ac
@@ -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