From: Arran Cudbard-Bell Date: Mon, 22 Feb 2021 12:25:37 +0000 (+0000) Subject: Fix documentation flag and re-enable -Wall for GCC X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bfc9829259717658ca23f6e4eb5f5efb45d67d73;p=thirdparty%2Ffreeradius-server.git Fix documentation flag and re-enable -Wall for GCC --- diff --git a/configure b/configure index 6247c4c6fde..371081aa3da 100755 --- a/configure +++ b/configure @@ -13039,60 +13039,6 @@ if test "x$developer" = "xyes"; then $as_echo "$as_me: Setting additional developer CFLAGS" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the compiler flag \"-Wdocumentation\"" >&5 -$as_echo_n "checking for the compiler flag \"-Wdocumentation\"... " >&6; } -if ${ax_cv_cc_wdocumentation_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - CFLAGS_SAVED=$CFLAGS - CFLAGS="$CFLAGS -Werror -Wdocumentation" - - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ax_cv_cc_wdocumentation_flag="yes" -else - ax_cv_cc_wdocumentation_flag="no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - CFLAGS="$CFLAGS_SAVED" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_wdocumentation_flag" >&5 -$as_echo "$ax_cv_cc_wdocumentation_flag" >&6; } - - if test "x$ax_cv_cc_wdocumentation_flag" = "xyes"; then - devcflags="-Wdocumentation" - -$as_echo "#define HAVE_WDOCUMENTATION 1" >>confdefs.h - - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the compiler flag \"-Weverything\"" >&5 $as_echo_n "checking for the compiler flag \"-Weverything\"... " >&6; } if ${ax_cv_cc_weverything_flag+:} false; then : @@ -13194,6 +13140,60 @@ $as_echo "$ax_cv_cc_weverything_flag" >&6; } fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the compiler flag \"-Wdocumentation\"" >&5 +$as_echo_n "checking for the compiler flag \"-Wdocumentation\"... " >&6; } +if ${ax_cv_cc_wdocumentation_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + CFLAGS_SAVED=$CFLAGS + CFLAGS="$CFLAGS -Werror -Wdocumentation" + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ax_cv_cc_wdocumentation_flag="yes" +else + ax_cv_cc_wdocumentation_flag="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + CFLAGS="$CFLAGS_SAVED" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cc_wdocumentation_flag" >&5 +$as_echo "$ax_cv_cc_wdocumentation_flag" >&6; } + + if test "x$ax_cv_cc_wdocumentation_flag" = "xyes"; then + devcflags="$devcflags -Wdocumentation" + +$as_echo "#define HAVE_WDOCUMENTATION 1" >>confdefs.h + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the compiler flag \"-Wimplicit-fallthrough\"" >&5 $as_echo_n "checking for the compiler flag \"-Wimplicit-fallthrough\"... " >&6; } if ${ax_cv_cc_wimplicit_fallthrough_flag+:} false; then : diff --git a/configure.ac b/configure.ac index da8228bb240..2b9c6ebe091 100644 --- a/configure.ac +++ b/configure.ac @@ -1692,15 +1692,6 @@ AC_SUBST(LIBPREFIX) if test "x$developer" = "xyes"; then AC_MSG_NOTICE([Setting additional developer CFLAGS]) - dnl # - dnl # Tell the compiler to parse doxygen documentation and verify it against function and variable declarations - dnl # - AX_CC_WDOCUMENTATION_FLAG - if test "x$ax_cv_cc_wdocumentation_flag" = "xyes"; then - devcflags="-Wdocumentation" - AC_DEFINE([HAVE_WDOCUMENTATION],1,[Define if the compiler supports -Wdocumentation]) - fi - dnl # dnl # If we have -Weverything, it really means *everything* unlike -Wall dnl # It's so verbose we need to turn off warnings which aren't useful. @@ -1736,6 +1727,7 @@ if test "x$developer" = "xyes"; then if test "x$GCC" = "xyes"; then devcflags="$devcflags \ -W \ + -Wall \ -Wcast-align \ -Wcast-qual \ -Wformat-nonliteral \ @@ -1760,6 +1752,15 @@ if test "x$developer" = "xyes"; then fi fi + dnl # + dnl # Tell the compiler to parse doxygen documentation and verify it against function and variable declarations + dnl # + AX_CC_WDOCUMENTATION_FLAG + if test "x$ax_cv_cc_wdocumentation_flag" = "xyes"; then + devcflags="$devcflags -Wdocumentation" + AC_DEFINE([HAVE_WDOCUMENTATION],1,[Define if the compiler supports -Wdocumentation]) + fi + dnl # dnl # Older versions of GCC don't support this, but 7 seems to dnl #