summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-07-17 22:22:49 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-07-17 22:22:49 +0200
commitabe1aa5a290653e0598364a12b0d661d901afbdf (patch)
tree4460bbe85c3fce50e6e68f85c5dec5e32197c25b /configure
parente88bf592beecfe6933b65cb0807633c9ae1c537e (diff)
downloadtcpdump-abe1aa5a290653e0598364a12b0d661d901afbdf.tar.gz
Compile with '-Wunreachable-code-return' in devel mode if supported
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure43
1 files changed, 43 insertions, 0 deletions
diff --git a/configure b/configure
index d47bd319..eb33db18 100755
--- a/configure
+++ b/configure
@@ -7230,6 +7230,49 @@ 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 -Wunreachable-code-return option" >&5
+$as_echo_n "checking whether the compiler supports the -Wunreachable-code-return option... " >&6; }
+ save_CFLAGS="$CFLAGS"
+ if expr "x-Wunreachable-code-return" : "x-W.*" >/dev/null
+ then
+ CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -Wunreachable-code-return"
+ elif expr "x-Wunreachable-code-return" : "x-f.*" >/dev/null
+ then
+ CFLAGS="$CFLAGS -Werror -Wunreachable-code-return"
+ elif expr "x-Wunreachable-code-return" : "x-m.*" >/dev/null
+ then
+ CFLAGS="$CFLAGS -Werror -Wunreachable-code-return"
+ else
+ CFLAGS="$CFLAGS -Wunreachable-code-return"
+ 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 -Wunreachable-code-return"
+
+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 -Wused-but-marked-unused option" >&5
$as_echo_n "checking whether the compiler supports the -Wused-but-marked-unused option... " >&6; }
save_CFLAGS="$CFLAGS"