diff --git a/configure b/configure index de5dec196..5a648b395 100755 --- a/configure +++ b/configure @@ -4954,6 +4954,53 @@ 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 +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 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wunused-parameter" >&5 +$as_echo_n "checking whether C compiler accepts -Wunused-parameter... " >&6; } +if ${ax_cv_check_cflags__Werror___Wunused_parameter+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -Werror -Wunused-parameter" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ax_cv_check_cflags__Werror___Wunused_parameter=yes +else + ax_cv_check_cflags__Werror___Wunused_parameter=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags__Werror___Wunused_parameter" >&5 +$as_echo "$ax_cv_check_cflags__Werror___Wunused_parameter" >&6; } +if test x"$ax_cv_check_cflags__Werror___Wunused_parameter" = xyes; then : + CFLAGS="$CFLAGS -Wno-unused-but-set-parameter" +else + : +fi + + 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 + ac_ext=c ac_cpp='$CPP $CPPFLAGS' diff --git a/configure.ac b/configure.ac index b5cbe8304..acba4712d 100644 --- a/configure.ac +++ b/configure.ac @@ -212,6 +212,7 @@ dnl don't always care about a variable that may still be present in a build dnl without DEBUGMODE. Unused variables are optimized out anyway. check_cc_flag([-Wunused], [CFLAGS="$CFLAGS -Wno-unused"]) check_cc_flag([-Wunused-parameter], [CFLAGS="$CFLAGS -Wno-unused-parameter"]) +check_cc_flag([-Wunused-parameter], [CFLAGS="$CFLAGS -Wno-unused-but-set-parameter"]) dnl We use this and this warning is meaningless since 'char' is always unsigned dnl in UnrealIRCd compiles (-funsigned-char).