summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2009-11-20 06:05:10 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2009-11-20 06:05:10 +0000
commitd4e2fb3ae45810b62e983938e2440061451d0c84 (patch)
tree5c5aaeae8ee88ad79cd6860783d3f4f2d74cb4ec /configure.in
parent694dc1648f1ac092c52655fccfb0503276310cb8 (diff)
downloademacs-d4e2fb3ae45810b62e983938e2440061451d0c84.tar.gz
Use -Wdeclaration-after-statement if available.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in13
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index d469cb13d44..a4abbe04d29 100644
--- a/configure.in
+++ b/configure.in
@@ -757,6 +757,19 @@ CFLAGS="$SAVE_CFLAGS"
unset has_option
unset SAVE_CFLAGS
+### Use -Wdeclaration-after-statement if the compiler supports it
+AC_MSG_CHECKING([whether gcc understands -Wdeclaration-after-statement])
+SAVE_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wdeclaration-after-statement"
+AC_TRY_COMPILE([], [], has_option=yes, has_option=no,)
+if test $has_option = yes; then
+ C_WARNINGS_SWITCH="-Wdeclaration-after-statement $C_WARNINGS_SWITCH"
+fi
+AC_MSG_RESULT($has_option)
+CFLAGS="$SAVE_CFLAGS"
+unset has_option
+unset SAVE_CFLAGS
+
#### Some other nice autoconf tests.
dnl checks for programs