diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2007-03-26 00:32:13 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2007-03-26 00:32:13 +0000 |
commit | d14c5ba107f365708118121ad1c7053f3979efeb (patch) | |
tree | d67a88f6d756e9fc9f1b3e4caf0f9beaf928968c | |
parent | 09814fac51a6ab6d3d1c87c290fbefd85b2ce3e4 (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.in | 8 |
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]], [ |