diff options
author | Stefan Fritsch <sf@apache.org> | 2011-10-08 09:48:01 +0200 |
---|---|---|
committer | Stefan Fritsch <sf@apache.org> | 2011-10-08 09:48:01 +0200 |
commit | 03227ed1c40290d0db2abcf6e6f70b4d28c5a92d (patch) | |
tree | 65bbed0d0b8236b1337d3f0574724b34af0fd6b2 /configure.in | |
parent | Add another AP_DEBUG_ASSERT to document some assumptions in the code, (diff) | |
download | apache2-03227ed1c40290d0db2abcf6e6f70b4d28c5a92d.tar.xz apache2-03227ed1c40290d0db2abcf6e6f70b4d28c5a92d.zip |
Add some CFLAGS in maintainer mode if supported by gcc:
-Wformat
-Wformat-security
-Werror=format-security
-Werror=declaration-after-statement
Add new macro APACHE_ADD_GCC_CFLAGS to do the compatibility check.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180331 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/configure.in b/configure.in index 8552213417..43ecea81e9 100644 --- a/configure.in +++ b/configure.in @@ -541,16 +541,11 @@ AC_ARG_ENABLE(maintainer-mode,APACHE_HELP_STRING(--enable-maintainer-mode,Turn o APR_ADDTO(CPPFLAGS, -DAP_DEBUG) if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wpointer-arith]) - AC_CACHE_CHECK([whether gcc accepts -Wdeclaration-after-statement], [ap_cv_cc_Wdas], [ - save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -Wdeclaration-after-statement" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([int foo() { return 0; }])], - [ap_cv_cc_Wdas=yes], [ap_cv_cc_Wdas=no]) - CFLAGS=$save_CFLAGS - ]) - if test "$ap_cv_cc_Wdas" = "yes"; then - APR_ADDTO(CFLAGS,[-Wdeclaration-after-statement]) - fi + APACHE_ADD_GCC_CFLAG([-Wdeclaration-after-statement]) + APACHE_ADD_GCC_CFLAG([-Werror=declaration-after-statement]) + APACHE_ADD_GCC_CFLAG([-Wformat]) + APACHE_ADD_GCC_CFLAG([-Wformat-security]) + APACHE_ADD_GCC_CFLAG([-Werror=format-security]) elif test "$AIX_XLC" = "yes"; then APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE -qcheck=all -qinfo=pro) fi @@ -561,16 +556,11 @@ AC_ARG_ENABLE(debugger-mode,APACHE_HELP_STRING(--enable-debugger-mode,Turn on de APR_ADDTO(CPPFLAGS, -DAP_DEBUG) if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wpointer-arith -O0]) - AC_CACHE_CHECK([whether gcc accepts -Wdeclaration-after-statement], [ap_cv_cc_Wdas], [ - save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -Wdeclaration-after-statement" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([int foo() { return 0; }])], - [ap_cv_cc_Wdas=yes], [ap_cv_cc_Wdas=no]) - CFLAGS=$save_CFLAGS - ]) - if test "$ap_cv_cc_Wdas" = "yes"; then - APR_ADDTO(CFLAGS,[-Wdeclaration-after-statement]) - fi + APACHE_ADD_GCC_CFLAG([-Wdeclaration-after-statement]) + APACHE_ADD_GCC_CFLAG([-Werror=declaration-after-statement]) + APACHE_ADD_GCC_CFLAG([-Wformat]) + APACHE_ADD_GCC_CFLAG([-Wformat-security]) + APACHE_ADD_GCC_CFLAG([-Werror=format-security]) elif test "$AIX_XLC" = "yes"; then APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE -qcheck=all -qinfo=pro) fi |