From efe4174e59dc462130fde872365e891a7c73654a Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 10 Dec 2013 20:47:51 +0100 Subject: Changed plugin extension from .so to .dylib on OS X - No functional changes. That's just the correct OS X file extension for dynamic libs. Signed-off-by: Haru --- configure | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index bf0a4d8ea..82466cad8 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in 0219c4d. +# From configure.in 4d13474. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -6473,6 +6473,9 @@ CYGWIN*) fd_setsize="done" DLLEXT=".dll" ;; +Darwin*) + DLLEXT=".dylib" + ;; esac -- cgit v1.2.3-70-g09d2 From 3cd9f8d14eaccaffaa642b5e46f50493c213e7d8 Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 17 Dec 2013 01:12:19 +0100 Subject: Increased warnings level in the unix build scripts - They are now on par with the Xcode project (and similar to the MSVC ones) - this will make it easier to notice issues before committing in future. - If this causes, on your system, warnings that we didn't detect, please let us know! Signed-off-by: Haru --- configure | 267 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- configure.in | 162 ++++++++++++++++++++++++++++++++++-- 2 files changed, 408 insertions(+), 21 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 82466cad8..28c9f9361 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in 4d13474. +# From configure.in 547ee9a. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -4566,7 +4566,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -CFLAGS="$CFLAGS -pipe -ffast-math -Wall -Wno-sign-compare" +CFLAGS="$CFLAGS -pipe -ffast-math -Wall -Wextra -Wno-sign-compare" CPPFLAGS="$CPPFLAGS -I../common" @@ -4994,11 +4994,57 @@ fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-maybe-uninitialized" >&5 +$as_echo_n "checking whether $CC supports -Wno-maybe-uninitialized... " >&6; } +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wno-maybe-uninitialized" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-maybe-uninitialized" >&5 +$as_echo_n "checking whether $CC can actually use -Wno-maybe-uninitialized... " >&6; } + # Note: -Werror must be before -Wno-maybe-uninitialized, otherwise it does not do anything + CFLAGS="$OLD_CFLAGS -Werror -Wno-maybe-uninitialized" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wno-maybe-uninitialized" + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-pointer-sign" >&5 -$as_echo_n "checking whether $CC supports -Wno-pointer-sign... " >&6; } +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-clobbered" >&5 +$as_echo_n "checking whether $CC supports -Wno-clobbered... " >&6; } OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wno-pointer-sign" +CFLAGS="$CFLAGS -Wno-clobbered" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; @@ -5007,11 +5053,10 @@ if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-pointer-sign" >&5 -$as_echo_n "checking whether $CC can actually use -Wno-pointer-sign... " >&6; } - # This option causes warnings in C++ mode - # Note: -Werror must be before -Wno-pointer-sign, otherwise it does not do anything - CFLAGS="$OLD_CFLAGS -Werror -Wno-pointer-sign" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-clobbered" >&5 +$as_echo_n "checking whether $CC can actually use -Wno-clobbered... " >&6; } + # Note: -Werror must be before -Wno-clobbered, otherwise it does not do anything + CFLAGS="$OLD_CFLAGS -Werror -Wno-clobbered" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; @@ -5020,7 +5065,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - CFLAGS="$OLD_CFLAGS -Wno-pointer-sign" + CFLAGS="$OLD_CFLAGS -Wno-clobbered" else @@ -5043,6 +5088,182 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wempty-body" >&5 +$as_echo_n "checking whether $CC supports -Wempty-body... " >&6; } +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wempty-body" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wnewline-eof" >&5 +$as_echo_n "checking whether $CC supports -Wnewline-eof... " >&6; } +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wnewline-eof" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wshadow" >&5 +$as_echo_n "checking whether $CC supports -Wshadow... " >&6; } +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wshadow" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wint-conversion" >&5 +$as_echo_n "checking whether $CC supports -Wint-conversion... " >&6; } +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wenum-conversion" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wenum-conversion" >&5 +$as_echo_n "checking whether $CC supports -Wenum-conversion... " >&6; } +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wenum-conversion" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wshorten-64-to-32" >&5 +$as_echo_n "checking whether $CC supports -Wshorten-64-to-32... " >&6; } +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wshorten-64-to-32" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wconstant-conversion" >&5 +$as_echo_n "checking whether $CC supports -Wconstant-conversion... " >&6; } +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wconstant-conversion" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wbool-conversion" >&5 +$as_echo_n "checking whether $CC supports -Wbool-conversion... " >&6; } +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wbool-conversion" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-switch" >&5 $as_echo_n "checking whether $CC supports -Wno-switch... " >&6; } OLD_CFLAGS="$CFLAGS" @@ -5065,6 +5286,28 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-missing-field-initializers" >&5 +$as_echo_n "checking whether $CC supports -Wno-missing-field-initializers... " >&6; } +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wno-missing-field-initializers" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fPIC" >&5 $as_echo_n "checking whether $CC supports -fPIC... " >&6; } OLD_CFLAGS="$CFLAGS" @@ -5470,7 +5713,7 @@ fi case $enable_debug in "no") # default value - CFLAGS="$CFLAGS -Wno-unused -Wno-parentheses" +# CFLAGS="$CFLAGS -Wno-unused -Wno-parentheses" ;; "yes") CFLAGS="$CFLAGS -g -DDEBUG" diff --git a/configure.in b/configure.in index 7db4ceda6..e8e2eba3f 100644 --- a/configure.in +++ b/configure.in @@ -433,7 +433,7 @@ AC_PATH_PROG(AR, ar) AC_LANG([C]) -CFLAGS="$CFLAGS -pipe -ffast-math -Wall -Wno-sign-compare" +CFLAGS="$CFLAGS -pipe -ffast-math -Wall -Wextra -Wno-sign-compare" CPPFLAGS="$CPPFLAGS -I../common" @@ -563,23 +563,50 @@ if test "$enable_lto" != "no" ; then fi +AC_MSG_CHECKING([whether $CC supports -Wno-maybe-uninitialized]) +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wno-maybe-uninitialized" +AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([int foo;])], + [ + AC_MSG_RESULT([yes]) + AC_MSG_CHECKING([whether $CC can actually use -Wno-maybe-uninitialized]) + # Note: -Werror must be before -Wno-maybe-uninitialized, otherwise it does not do anything + CFLAGS="$OLD_CFLAGS -Werror -Wno-maybe-uninitialized" + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([int foo;])], + [ + AC_MSG_RESULT([yes]) + CFLAGS="$OLD_CFLAGS -Wno-maybe-uninitialized" + ], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + ] + ) + ], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + ] +) + -AC_MSG_CHECKING([whether $CC supports -Wno-pointer-sign]) +AC_MSG_CHECKING([whether $CC supports -Wno-clobbered]) OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wno-pointer-sign" +CFLAGS="$CFLAGS -Wno-clobbered" AC_COMPILE_IFELSE( [AC_LANG_SOURCE([int foo;])], [ AC_MSG_RESULT([yes]) - AC_MSG_CHECKING([whether $CC can actually use -Wno-pointer-sign]) - # This option causes warnings in C++ mode - # Note: -Werror must be before -Wno-pointer-sign, otherwise it does not do anything - CFLAGS="$OLD_CFLAGS -Werror -Wno-pointer-sign" + AC_MSG_CHECKING([whether $CC can actually use -Wno-clobbered]) + # Note: -Werror must be before -Wno-clobbered, otherwise it does not do anything + CFLAGS="$OLD_CFLAGS -Werror -Wno-clobbered" AC_COMPILE_IFELSE( [AC_LANG_SOURCE([int foo;])], [ AC_MSG_RESULT([yes]) - CFLAGS="$OLD_CFLAGS -Wno-pointer-sign" + CFLAGS="$OLD_CFLAGS -Wno-clobbered" ], [ AC_MSG_RESULT([no]) @@ -594,6 +621,110 @@ AC_COMPILE_IFELSE( ) +AC_MSG_CHECKING([whether $CC supports -Wempty-body]) +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wempty-body" +AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([int foo;])], + [AC_MSG_RESULT([yes])], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + ] +) + + +AC_MSG_CHECKING([whether $CC supports -Wnewline-eof]) +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wnewline-eof" +AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([int foo;])], + [AC_MSG_RESULT([yes])], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + ] +) + + +AC_MSG_CHECKING([whether $CC supports -Wshadow]) +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wshadow" +AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([int foo;])], + [AC_MSG_RESULT([yes])], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + ] +) + + +AC_MSG_CHECKING([whether $CC supports -Wint-conversion]) +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wenum-conversion" +AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([int foo;])], + [AC_MSG_RESULT([yes])], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + ] +) + + +AC_MSG_CHECKING([whether $CC supports -Wenum-conversion]) +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wenum-conversion" +AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([int foo;])], + [AC_MSG_RESULT([yes])], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + ] +) + + +AC_MSG_CHECKING([whether $CC supports -Wshorten-64-to-32]) +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wshorten-64-to-32" +AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([int foo;])], + [AC_MSG_RESULT([yes])], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + ] +) + + +AC_MSG_CHECKING([whether $CC supports -Wconstant-conversion]) +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wconstant-conversion" +AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([int foo;])], + [AC_MSG_RESULT([yes])], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + ] +) + + +AC_MSG_CHECKING([whether $CC supports -Wbool-conversion]) +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wbool-conversion" +AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([int foo;])], + [AC_MSG_RESULT([yes])], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + ] +) + + AC_MSG_CHECKING([whether $CC supports -Wno-switch]) OLD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wno-switch" @@ -607,6 +738,19 @@ AC_COMPILE_IFELSE( ) +AC_MSG_CHECKING([whether $CC supports -Wno-missing-field-initializers]) +OLD_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Wno-missing-field-initializers" +AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([int foo;])], + [AC_MSG_RESULT([yes])], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + ] +) + + AC_MSG_CHECKING([whether $CC supports -fPIC]) OLD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fPIC" @@ -870,7 +1014,7 @@ fi case $enable_debug in "no") # default value - CFLAGS="$CFLAGS -Wno-unused -Wno-parentheses" +# CFLAGS="$CFLAGS -Wno-unused -Wno-parentheses" ;; "yes") CFLAGS="$CFLAGS -g -DDEBUG" -- cgit v1.2.3-70-g09d2 From 3917562fc493c031bb20181b5d9ae6ab15ce9b76 Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 17 Dec 2013 03:33:20 +0100 Subject: Fixed some additional linux warnings - Fixed some warnings we had missed. - Improved -W cflag detection routines. - Only use -Wshadow if it's actually useful. Signed-off-by: Haru --- configure | 929 ++++++++++++++++++++++++++++++++++++++++++----------- configure.in | 315 +++++++----------- src/common/timer.c | 8 +- 3 files changed, 863 insertions(+), 389 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 28c9f9361..7142ed479 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in 547ee9a. +# From configure.in d0f16b7. # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # @@ -3643,12 +3643,12 @@ fi # Check whether --enable-lto was given. if test "${enable_lto+set}" = set; then : enableval=$enable_lto; - enable_lto="$enableval" - case $enableval in - "no");; - "yes");; - *) as_fn_error $? "invalid argument --enable-lto=$disableval... stopping" "$LINENO" 5;; - esac + enable_lto="$enableval" + case $enableval in + "no");; + "yes");; + *) as_fn_error $? "invalid argument --enable-lto=$disableval... stopping" "$LINENO" 5;; + esac else enable_lto="yes" @@ -4924,28 +4924,6 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-unused-parameter" >&5 -$as_echo_n "checking whether $CC supports -Wno-unused-parameter... " >&6; } -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wno-unused-parameter" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" - - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - # # LTO Support test # @@ -4970,8 +4948,8 @@ else /* end confdefs.h. */ int main(int argc, char **argv){ - return 0; - } + return 0; + } _ACEOF if ac_fn_c_try_run "$LINENO"; then : @@ -4994,319 +4972,880 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-maybe-uninitialized" >&5 -$as_echo_n "checking whether $CC supports -Wno-maybe-uninitialized... " >&6; } -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wno-maybe-uninitialized" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-unused-parameter" >&5 +$as_echo_n "checking whether $CC supports -Wno-unused-parameter... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wno-unused-parameter" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-maybe-uninitialized" >&5 -$as_echo_n "checking whether $CC can actually use -Wno-maybe-uninitialized... " >&6; } - # Note: -Werror must be before -Wno-maybe-uninitialized, otherwise it does not do anything - CFLAGS="$OLD_CFLAGS -Werror -Wno-maybe-uninitialized" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # Recent versions of gcc don't fail if -Wno-foo is not recognized + # (unless there are also other warnings), so we also check for -Wfoo + # which always fails if not supported + CFLAGS="$OLD_CFLAGS -Werror -Wunused-parameter" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - CFLAGS="$OLD_CFLAGS -Wno-maybe-uninitialized" + CFLAGS="$OLD_CFLAGS -Wno-unused-parameter" + # Optionally, run a test + if test "xint foo(int bar) { return 0; }" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-unused-parameter" >&5 +$as_echo_n "checking whether $CC can actually use -Wno-unused-parameter... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wunused-parameter" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo(int bar) { return 0; } +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not needed but enabled" >&5 +$as_echo "not needed but enabled" >&6; } + CFLAGS="$OLD_CFLAGS" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + CFLAGS="$OLD_CFLAGS -Werror -Wno-unused-parameter" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo(int bar) { return 0; } +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wno-unused-parameter" + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" + CFLAGS="$OLD_CFLAGS" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" + CFLAGS="$OLD_CFLAGS" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-clobbered" >&5 -$as_echo_n "checking whether $CC supports -Wno-clobbered... " >&6; } -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wno-clobbered" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-maybe-uninitialized" >&5 +$as_echo_n "checking whether $CC supports -Wno-maybe-uninitialized... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wno-maybe-uninitialized" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-clobbered" >&5 -$as_echo_n "checking whether $CC can actually use -Wno-clobbered... " >&6; } - # Note: -Werror must be before -Wno-clobbered, otherwise it does not do anything - CFLAGS="$OLD_CFLAGS -Werror -Wno-clobbered" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # Recent versions of gcc don't fail if -Wno-foo is not recognized + # (unless there are also other warnings), so we also check for -Wfoo + # which always fails if not supported + CFLAGS="$OLD_CFLAGS -Werror -Wmaybe-uninitialized" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - CFLAGS="$OLD_CFLAGS -Wno-clobbered" + CFLAGS="$OLD_CFLAGS -Wno-maybe-uninitialized" + # Optionally, run a test + if test "x" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-maybe-uninitialized" >&5 +$as_echo_n "checking whether $CC can actually use -Wno-maybe-uninitialized... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wmaybe-uninitialized" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not needed but enabled" >&5 +$as_echo "not needed but enabled" >&6; } + CFLAGS="$OLD_CFLAGS" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" + CFLAGS="$OLD_CFLAGS -Werror -Wno-maybe-uninitialized" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wno-maybe-uninitialized" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" + CFLAGS="$OLD_CFLAGS" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wempty-body" >&5 -$as_echo_n "checking whether $CC supports -Wempty-body... " >&6; } -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wempty-body" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" + CFLAGS="$OLD_CFLAGS" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wnewline-eof" >&5 -$as_echo_n "checking whether $CC supports -Wnewline-eof... " >&6; } -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wnewline-eof" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" + CFLAGS="$OLD_CFLAGS" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wshadow" >&5 -$as_echo_n "checking whether $CC supports -Wshadow... " >&6; } -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wshadow" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-clobbered" >&5 +$as_echo_n "checking whether $CC supports -Wno-clobbered... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wno-clobbered" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wint-conversion" >&5 -$as_echo_n "checking whether $CC supports -Wint-conversion... " >&6; } -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wenum-conversion" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # Recent versions of gcc don't fail if -Wno-foo is not recognized + # (unless there are also other warnings), so we also check for -Wfoo + # which always fails if not supported + CFLAGS="$OLD_CFLAGS -Werror -Wclobbered" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wno-clobbered" + # Optionally, run a test + if test "x" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-clobbered" >&5 +$as_echo_n "checking whether $CC can actually use -Wno-clobbered... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wclobbered" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not needed but enabled" >&5 +$as_echo "not needed but enabled" >&6; } + CFLAGS="$OLD_CFLAGS" +else -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wenum-conversion" >&5 -$as_echo_n "checking whether $CC supports -Wenum-conversion... " >&6; } -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wenum-conversion" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + CFLAGS="$OLD_CFLAGS -Werror -Wno-clobbered" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -int foo; + _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wno-clobbered" + else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" + CFLAGS="$OLD_CFLAGS" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wshorten-64-to-32" >&5 -$as_echo_n "checking whether $CC supports -Wshorten-64-to-32... " >&6; } -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wshorten-64-to-32" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" + CFLAGS="$OLD_CFLAGS" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wconstant-conversion" >&5 -$as_echo_n "checking whether $CC supports -Wconstant-conversion... " >&6; } -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wconstant-conversion" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" + CFLAGS="$OLD_CFLAGS" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wbool-conversion" >&5 -$as_echo_n "checking whether $CC supports -Wbool-conversion... " >&6; } -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wbool-conversion" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wempty-body" >&5 +$as_echo_n "checking whether $CC supports -Wempty-body... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wempty-body" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -else + CFLAGS="$OLD_CFLAGS -Wempty-body" + # Optionally, run a test + if test "x" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wempty-body" >&5 +$as_echo_n "checking whether $CC can actually use -Wempty-body... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wempty-body" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" + CFLAGS="$OLD_CFLAGS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wempty-body" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-switch" >&5 -$as_echo_n "checking whether $CC supports -Wno-switch... " >&6; } -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wno-switch" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" + CFLAGS="$OLD_CFLAGS" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-missing-field-initializers" >&5 -$as_echo_n "checking whether $CC supports -Wno-missing-field-initializers... " >&6; } -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wno-missing-field-initializers" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wnewline-eof" >&5 +$as_echo_n "checking whether $CC supports -Wnewline-eof... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wnewline-eof" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -else + CFLAGS="$OLD_CFLAGS -Wnewline-eof" + # Optionally, run a test + if test "x" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wnewline-eof" >&5 +$as_echo_n "checking whether $CC can actually use -Wnewline-eof... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wnewline-eof" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - CFLAGS="$OLD_CFLAGS" + CFLAGS="$OLD_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wnewline-eof" + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wint-conversion" >&5 +$as_echo_n "checking whether $CC supports -Wint-conversion... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wint-conversion" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wint-conversion" + # Optionally, run a test + if test "x" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wint-conversion" >&5 +$as_echo_n "checking whether $CC can actually use -Wint-conversion... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wint-conversion" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wint-conversion" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wenum-conversion" >&5 +$as_echo_n "checking whether $CC supports -Wenum-conversion... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wenum-conversion" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wenum-conversion" + # Optionally, run a test + if test "x" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wenum-conversion" >&5 +$as_echo_n "checking whether $CC can actually use -Wenum-conversion... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wenum-conversion" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wenum-conversion" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wshorten-64-to-32" >&5 +$as_echo_n "checking whether $CC supports -Wshorten-64-to-32... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wshorten-64-to-32" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wshorten-64-to-32" + # Optionally, run a test + if test "x" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wshorten-64-to-32" >&5 +$as_echo_n "checking whether $CC can actually use -Wshorten-64-to-32... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wshorten-64-to-32" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wshorten-64-to-32" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wconstant-conversion" >&5 +$as_echo_n "checking whether $CC supports -Wconstant-conversion... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wconstant-conversion" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wconstant-conversion" + # Optionally, run a test + if test "x" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wconstant-conversion" >&5 +$as_echo_n "checking whether $CC can actually use -Wconstant-conversion... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wconstant-conversion" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wconstant-conversion" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wbool-conversion" >&5 +$as_echo_n "checking whether $CC supports -Wbool-conversion... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wbool-conversion" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wbool-conversion" + # Optionally, run a test + if test "x" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wbool-conversion" >&5 +$as_echo_n "checking whether $CC can actually use -Wbool-conversion... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wbool-conversion" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wbool-conversion" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-switch" >&5 +$as_echo_n "checking whether $CC supports -Wno-switch... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wno-switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Recent versions of gcc don't fail if -Wno-foo is not recognized + # (unless there are also other warnings), so we also check for -Wfoo + # which always fails if not supported + CFLAGS="$OLD_CFLAGS -Werror -Wswitch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wno-switch" + # Optionally, run a test + if test "x" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-switch" >&5 +$as_echo_n "checking whether $CC can actually use -Wno-switch... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wswitch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not needed but enabled" >&5 +$as_echo "not needed but enabled" >&6; } + CFLAGS="$OLD_CFLAGS" + +else + + CFLAGS="$OLD_CFLAGS -Werror -Wno-switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wno-switch" + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wno-missing-field-initializers" >&5 +$as_echo_n "checking whether $CC supports -Wno-missing-field-initializers... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wno-missing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Recent versions of gcc don't fail if -Wno-foo is not recognized + # (unless there are also other warnings), so we also check for -Wfoo + # which always fails if not supported + CFLAGS="$OLD_CFLAGS -Werror -Wmissing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wno-missing-field-initializers" + # Optionally, run a test + if test "x" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wno-missing-field-initializers" >&5 +$as_echo_n "checking whether $CC can actually use -Wno-missing-field-initializers... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wmissing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not needed but enabled" >&5 +$as_echo "not needed but enabled" >&6; } + CFLAGS="$OLD_CFLAGS" + +else + + CFLAGS="$OLD_CFLAGS -Werror -Wno-missing-field-initializers" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wno-missing-field-initializers" + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + +# Certain versions of gcc make -Wshadow completely useless by making it flood +# you with unnecessary warnings +# Let's check if we can really use it +SAVED_OLD_CFLAGS="$CFLAGS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -Wshadow" >&5 +$as_echo_n "checking whether $CC supports -Wshadow... " >&6; } + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wshadow" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wshadow" + # Optionally, run a test + if test "x" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can actually use -Wshadow" >&5 +$as_echo_n "checking whether $CC can actually use -Wshadow... " >&6; } + CFLAGS="$OLD_CFLAGS -Werror -Wshadow" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$OLD_CFLAGS -Wshadow" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + +if test "x$CFLAGS" != "x$SAVED_OLD_CFLAGS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC can efficiently use -Wshadow" >&5 +$as_echo_n "checking whether $CC can efficiently use -Wshadow... " >&6; } + NEW_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wshadow" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int foo(void) { + return 0; + } + int bar(void) { + int foo = 0; + return foo + 1; + } + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$NEW_CFLAGS" + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CFLAGS="$SAVED_OLD_CFLAGS" + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fPIC" >&5 $as_echo_n "checking whether $CC supports -fPIC... " >&6; } diff --git a/configure.in b/configure.in index e8e2eba3f..94bad9ca4 100644 --- a/configure.in +++ b/configure.in @@ -248,22 +248,22 @@ AC_ARG_ENABLE( # LTO # AC_ARG_ENABLE( - [lto], - AC_HELP_STRING( - [--enable-lto], - [ + [lto], + AC_HELP_STRING( + [--enable-lto], + [ Enables or Disables Linktime Code Optimization (LTO is enabled by default) - ] - ), - [ - enable_lto="$enableval" - case $enableval in - "no");; - "yes");; - *) AC_MSG_ERROR([[invalid argument --enable-lto=$disableval... stopping]]);; - esac - ], - [enable_lto="yes"] + ] + ), + [ + enable_lto="$enableval" + case $enableval in + "no");; + "yes");; + *) AC_MSG_ERROR([[invalid argument --enable-lto=$disableval... stopping]]);; + esac + ], + [enable_lto="yes"] ) @@ -517,19 +517,6 @@ AC_RUN_IFELSE( ) -AC_MSG_CHECKING([whether $CC supports -Wno-unused-parameter]) -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wno-unused-parameter" -AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([int foo;])], - [AC_MSG_RESULT([yes])], - [ - AC_MSG_RESULT([no]) - CFLAGS="$OLD_CFLAGS" - ] -) - - # # LTO Support test # @@ -545,8 +532,8 @@ if test "$enable_lto" != "no" ; then AC_RUN_IFELSE( [AC_LANG_SOURCE([ int main(int argc, char **argv){ - return 0; - } + return 0; + } ])], [ AC_MSG_RESULT([yes]) @@ -563,193 +550,141 @@ if test "$enable_lto" != "no" ; then fi -AC_MSG_CHECKING([whether $CC supports -Wno-maybe-uninitialized]) -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wno-maybe-uninitialized" -AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([int foo;])], +AC_DEFUN(AC_CHECK_COMPILER_WFLAG, [ - AC_MSG_RESULT([yes]) - AC_MSG_CHECKING([whether $CC can actually use -Wno-maybe-uninitialized]) - # Note: -Werror must be before -Wno-maybe-uninitialized, otherwise it does not do anything - CFLAGS="$OLD_CFLAGS -Werror -Wno-maybe-uninitialized" + AC_MSG_CHECKING([whether $CC supports -W$1]) + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -W$1" AC_COMPILE_IFELSE( [AC_LANG_SOURCE([int foo;])], [ AC_MSG_RESULT([yes]) - CFLAGS="$OLD_CFLAGS -Wno-maybe-uninitialized" + CFLAGS="$OLD_CFLAGS -W$1" + # Optionally, run a test + if test "x$2" != "x"; then + AC_MSG_CHECKING([whether $CC can actually use -W$1]) + CFLAGS="$OLD_CFLAGS -Werror -W$1" + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([$2])], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + ] + [ + AC_MSG_RESULT([yes]) + CFLAGS="$OLD_CFLAGS -W$1" + ], + ) + fi ], [ AC_MSG_RESULT([no]) CFLAGS="$OLD_CFLAGS" ] ) - ], - [ - AC_MSG_RESULT([no]) - CFLAGS="$OLD_CFLAGS" ] ) - -AC_MSG_CHECKING([whether $CC supports -Wno-clobbered]) -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wno-clobbered" -AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([int foo;])], +AC_DEFUN(AC_CHECK_COMPILER_WNOFLAG, [ - AC_MSG_RESULT([yes]) - AC_MSG_CHECKING([whether $CC can actually use -Wno-clobbered]) - # Note: -Werror must be before -Wno-clobbered, otherwise it does not do anything - CFLAGS="$OLD_CFLAGS -Werror -Wno-clobbered" + AC_MSG_CHECKING([whether $CC supports -Wno-$1]) + OLD_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wno-$1" AC_COMPILE_IFELSE( [AC_LANG_SOURCE([int foo;])], [ - AC_MSG_RESULT([yes]) - CFLAGS="$OLD_CFLAGS -Wno-clobbered" + # Recent versions of gcc don't fail if -Wno-foo is not recognized + # (unless there are also other warnings), so we also check for -Wfoo + # which always fails if not supported + CFLAGS="$OLD_CFLAGS -Werror -W$1" + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([int foo;])], + [ + AC_MSG_RESULT([yes]) + CFLAGS="$OLD_CFLAGS -Wno-$1" + # Optionally, run a test + if test "x$2" != "x"; then + AC_MSG_CHECKING([whether $CC can actually use -Wno-$1]) + CFLAGS="$OLD_CFLAGS -Werror -W$1" + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([$2])], + [ + AC_MSG_RESULT([not needed but enabled]) + CFLAGS="$OLD_CFLAGS" + ], + [ + CFLAGS="$OLD_CFLAGS -Werror -Wno-$1" + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([$2])], + [ + AC_MSG_RESULT([yes]) + CFLAGS="$OLD_CFLAGS -Wno-$1" + ], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + ] + ) + ] + ) + fi + ], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + ] + ) ], [ AC_MSG_RESULT([no]) CFLAGS="$OLD_CFLAGS" ] ) - ], - [ - AC_MSG_RESULT([no]) - CFLAGS="$OLD_CFLAGS" - ] -) - - -AC_MSG_CHECKING([whether $CC supports -Wempty-body]) -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wempty-body" -AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([int foo;])], - [AC_MSG_RESULT([yes])], - [ - AC_MSG_RESULT([no]) - CFLAGS="$OLD_CFLAGS" - ] -) - - -AC_MSG_CHECKING([whether $CC supports -Wnewline-eof]) -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wnewline-eof" -AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([int foo;])], - [AC_MSG_RESULT([yes])], - [ - AC_MSG_RESULT([no]) - CFLAGS="$OLD_CFLAGS" - ] -) - - -AC_MSG_CHECKING([whether $CC supports -Wshadow]) -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wshadow" -AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([int foo;])], - [AC_MSG_RESULT([yes])], - [ - AC_MSG_RESULT([no]) - CFLAGS="$OLD_CFLAGS" - ] -) - - -AC_MSG_CHECKING([whether $CC supports -Wint-conversion]) -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wenum-conversion" -AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([int foo;])], - [AC_MSG_RESULT([yes])], - [ - AC_MSG_RESULT([no]) - CFLAGS="$OLD_CFLAGS" - ] -) - - -AC_MSG_CHECKING([whether $CC supports -Wenum-conversion]) -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wenum-conversion" -AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([int foo;])], - [AC_MSG_RESULT([yes])], - [ - AC_MSG_RESULT([no]) - CFLAGS="$OLD_CFLAGS" - ] -) - - -AC_MSG_CHECKING([whether $CC supports -Wshorten-64-to-32]) -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wshorten-64-to-32" -AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([int foo;])], - [AC_MSG_RESULT([yes])], - [ - AC_MSG_RESULT([no]) - CFLAGS="$OLD_CFLAGS" - ] -) - - -AC_MSG_CHECKING([whether $CC supports -Wconstant-conversion]) -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wconstant-conversion" -AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([int foo;])], - [AC_MSG_RESULT([yes])], - [ - AC_MSG_RESULT([no]) - CFLAGS="$OLD_CFLAGS" - ] -) - - -AC_MSG_CHECKING([whether $CC supports -Wbool-conversion]) -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wbool-conversion" -AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([int foo;])], - [AC_MSG_RESULT([yes])], - [ - AC_MSG_RESULT([no]) - CFLAGS="$OLD_CFLAGS" - ] -) - - -AC_MSG_CHECKING([whether $CC supports -Wno-switch]) -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wno-switch" -AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([int foo;])], - [AC_MSG_RESULT([yes])], - [ - AC_MSG_RESULT([no]) - CFLAGS="$OLD_CFLAGS" - ] -) - - -AC_MSG_CHECKING([whether $CC supports -Wno-missing-field-initializers]) -OLD_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Wno-missing-field-initializers" -AC_COMPILE_IFELSE( - [AC_LANG_SOURCE([int foo;])], - [AC_MSG_RESULT([yes])], - [ - AC_MSG_RESULT([no]) - CFLAGS="$OLD_CFLAGS" ] ) +AC_CHECK_COMPILER_WNOFLAG(unused-parameter, [int foo(int bar) { return 0; }]) +AC_CHECK_COMPILER_WNOFLAG(maybe-uninitialized) +AC_CHECK_COMPILER_WNOFLAG(clobbered) +AC_CHECK_COMPILER_WFLAG(empty-body) +AC_CHECK_COMPILER_WFLAG(newline-eof) +AC_CHECK_COMPILER_WFLAG(int-conversion) +AC_CHECK_COMPILER_WFLAG(enum-conversion) +AC_CHECK_COMPILER_WFLAG(shorten-64-to-32) +AC_CHECK_COMPILER_WFLAG(constant-conversion) +AC_CHECK_COMPILER_WFLAG(bool-conversion) +AC_CHECK_COMPILER_WNOFLAG(switch) +AC_CHECK_COMPILER_WNOFLAG(missing-field-initializers) + +# Certain versions of gcc make -Wshadow completely useless by making it flood +# you with unnecessary warnings +# Let's check if we can really use it +SAVED_OLD_CFLAGS="$CFLAGS" +AC_CHECK_COMPILER_WFLAG(shadow) +if test "x$CFLAGS" != "x$SAVED_OLD_CFLAGS"; then + AC_MSG_CHECKING([whether $CC can efficiently use -Wshadow]) + NEW_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wshadow" + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([ + int foo(void) { + return 0; + } + int bar(void) { + int foo = 0; + return foo + 1; + } + ])], + [ + AC_MSG_RESULT([yes]) + CFLAGS="$NEW_CFLAGS" + ], + [ + AC_MSG_RESULT([no]) + CFLAGS="$SAVED_OLD_CFLAGS" + ] + ) +fi AC_MSG_CHECKING([whether $CC supports -fPIC]) OLD_CFLAGS="$CFLAGS" diff --git a/src/common/timer.c b/src/common/timer.c index e5cf5df2a..7f9e20dad 100644 --- a/src/common/timer.c +++ b/src/common/timer.c @@ -142,7 +142,7 @@ static void rdtsc_calibrate(){ * platform-abstracted tick retrieval * @return server's current tick */ -static int64 tick(void) { +static int64 sys_tick(void) { #if defined(WIN32) // Windows: GetTickCount/GetTickCount64: Return the number of // milliseconds that have elapsed since the system was started. @@ -206,7 +206,7 @@ static int gettick_count = 1; int64 timer_gettick_nocache(void) { gettick_count = TICK_CACHE; - gettick_cache = tick(); + gettick_cache = sys_tick(); return gettick_cache; } @@ -219,11 +219,11 @@ int64 timer_gettick(void) { // tick doesn't get cached int64 timer_gettick_nocache(void) { - return tick(); + return sys_tick(); } int64 timer_gettick(void) { - return tick(); + return sys_tick(); } ////////////////////////////////////////////////////////////////////////// #endif -- cgit v1.2.3-70-g09d2