aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2007-03-26 00:32:13 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2007-03-26 00:32:13 +0000
commitd14c5ba107f365708118121ad1c7053f3979efeb (patch)
treed67a88f6d756e9fc9f1b3e4caf0f9beaf928968c
parent09814fac51a6ab6d3d1c87c290fbefd85b2ce3e4 (diff)
If we're using gcc, try to use -Wdeclaration-after-statement to catch more non-portable commits. I'm not sure if this is the Right Way to test to see if the compiler can handle a specific option but it's simple and efficient enough.
svn path=/trunk/; revision=21195
-rw-r--r--configure.in8
1 files changed, 8 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 5dd3a58179..a5eb2119a5 100644
--- a/configure.in
+++ b/configure.in
@@ -174,6 +174,14 @@ else
AC_MSG_RESULT(no)
fi
+AC_MSG_CHECKING(to see if we can add '-Wdeclaration-after-statement' to CFLAGS)
+if test x$GCC != x && echo yes | $CC -E -Wdeclaration-after-statement - 2>&1 | grep yes > /dev/null ; then
+ CFLAGS="$CFLAGS -Wdeclaration-after-statement"
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
AC_ARG_WITH(warnings-as-errors,
[ --with-warnings-as-errors Treat warnings as errors (if using gcc). [default=no]],
[