diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -1672,16 +1672,38 @@ yes) test -z "`$CC --version 2>/dev/null | grep 'Free Software Foundation'`" then BASECFLAGS="$BASECFLAGS -Wunreachable-code" else ac_cv_enable_unreachable_code_warning=no fi AC_MSG_RESULT($ac_cv_enable_unreachable_code_warning) + AC_MSG_CHECKING(if we can make implicit function declaration an error in $CC) + ac_save_cc="$CC" + CC="$CC -Werror=implicit-function-declaration" + save_CFLAGS="$CFLAGS" + AC_CACHE_VAL(ac_cv_enable_implicit_function_declaration_error, + AC_COMPILE_IFELSE( + [ + AC_LANG_PROGRAM([[]], [[]]) + ],[ + ac_cv_enable_implicit_function_declaration_error=yes + ],[ + ac_cv_enable_implicit_function_declaration_error=no + ])) + CFLAGS="$save_CFLAGS" + CC="$ac_save_cc" + AC_MSG_RESULT($ac_cv_enable_implicit_function_declaration_error) + + if test $ac_cv_enable_implicit_function_declaration_error = yes + then + CFLAGS_NODIST="$CFLAGS_NODIST -Werror=implicit-function-declaration" + fi + # if using gcc on alpha, use -mieee to get (near) full IEEE 754 # support. Without this, treatment of subnormals doesn't follow # the standard. case $host in alpha*) BASECFLAGS="$BASECFLAGS -mieee" ;; esac