From: Guy Harris Date: Sat, 15 Sep 2018 20:16:02 +0000 (-0700) Subject: Don't warn about declarations after statements. X-Git-Tag: tcpdump-4.99-bp~1007 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/9008c09c88c31553beeb5051a637a86976d51abe?ds=sidebyside Don't warn about declarations after statements. We now allow them, and require a compiler that supports them, so there's no need to warn about them. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 9db60947..93592c3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -866,7 +866,6 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel) check_and_add_compiler_option(-Wall) check_and_add_compiler_option(-Wassign-enum) check_and_add_compiler_option(-Wcast-qual) - check_and_add_compiler_option(-Wdeclaration-after-statement) check_and_add_compiler_option(-Wmissing-prototypes) check_and_add_compiler_option(-Wold-style-definition) check_and_add_compiler_option(-Wpedantic) diff --git a/aclocal.m4 b/aclocal.m4 index 4d31f29c..bb322371 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -874,7 +874,6 @@ AC_DEFUN(AC_LBL_DEVEL, AC_LBL_CHECK_COMPILER_OPT($1, -Wall) AC_LBL_CHECK_COMPILER_OPT($1, -Wassign-enum) AC_LBL_CHECK_COMPILER_OPT($1, -Wcast-qual) - AC_LBL_CHECK_COMPILER_OPT($1, -Wdeclaration-after-statement) AC_LBL_CHECK_COMPILER_OPT($1, -Wmissing-prototypes) AC_LBL_CHECK_COMPILER_OPT($1, -Wold-style-definition) AC_LBL_CHECK_COMPILER_OPT($1, -Wpedantic) diff --git a/configure b/configure index 19259b41..b76db520 100755 --- a/configure +++ b/configure @@ -6920,49 +6920,6 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wdeclaration-after-statement option" >&5 -$as_echo_n "checking whether the compiler supports the -Wdeclaration-after-statement option... " >&6; } - save_CFLAGS="$CFLAGS" - if expr "x-Wdeclaration-after-statement" : "x-W.*" >/dev/null - then - CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -Wdeclaration-after-statement" - elif expr "x-Wdeclaration-after-statement" : "x-f.*" >/dev/null - then - CFLAGS="$CFLAGS -Werror -Wdeclaration-after-statement" - elif expr "x-Wdeclaration-after-statement" : "x-m.*" >/dev/null - then - CFLAGS="$CFLAGS -Werror -Wdeclaration-after-statement" - else - CFLAGS="$CFLAGS -Wdeclaration-after-statement" - fi - 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 : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - CFLAGS="$save_CFLAGS" - V_CCOPT="$V_CCOPT -Wdeclaration-after-statement" - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - CFLAGS="$save_CFLAGS" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the -Wmissing-prototypes option" >&5 $as_echo_n "checking whether the compiler supports the -Wmissing-prototypes option... " >&6; } save_CFLAGS="$CFLAGS"