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
This commit is contained in:
Jeff Morriss 2007-03-26 00:32:13 +00:00
parent 09814fac51
commit d14c5ba107
1 changed files with 8 additions and 0 deletions

View File

@ -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]],
[