Mercurial > emacs
diff configure.in @ 106158:734dbd0c890e
Use -Wdeclaration-after-statement if available.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Fri, 20 Nov 2009 06:05:10 +0000 |
parents | cd4cbab8bb21 |
children | b5eb529d2739 |
line wrap: on
line diff
--- a/configure.in Fri Nov 20 05:44:49 2009 +0000 +++ b/configure.in Fri Nov 20 06:05:10 2009 +0000 @@ -757,6 +757,19 @@ 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