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
commit7a2efa6f088dee91feb2c095f81cf9c2030c2e97 (patch)
tree1ab2d0dd5239c29fa3eea17b13187badeb850be0 /configure.in
parent9717f1199f337920aeeb66417233c28d5f978f79 (diff)
downloademacs-7a2efa6f088dee91feb2c095f81cf9c2030c2e97.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