summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-10-29 22:28:53 +0100
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2018-10-29 22:28:53 +0100
commitf34af1aa63da301ae7ee91e2300dff31702001f0 (patch)
tree2e04cf288de788b8358f491a56f0126876f004fd
parentf839f799b7aedf4363cf74fea6825ae1bdd73e0d (diff)
downloadtcpdump-f34af1aa63da301ae7ee91e2300dff31702001f0.tar.gz
Compile with '-Wsign-compare' in devel mode if supported
-rw-r--r--aclocal.m41
-rwxr-xr-xconfigure43
2 files changed, 44 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index bb322371..2b45203d 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -879,6 +879,7 @@ AC_DEFUN(AC_LBL_DEVEL,
AC_LBL_CHECK_COMPILER_OPT($1, -Wpedantic)
AC_LBL_CHECK_COMPILER_OPT($1, -Wpointer-arith)
AC_LBL_CHECK_COMPILER_OPT($1, -Wshadow)
+ AC_LBL_CHECK_COMPILER_OPT($1, -Wsign-compare)
AC_LBL_CHECK_COMPILER_OPT($1, -Wstrict-prototypes)
AC_LBL_CHECK_COMPILER_OPT($1, -Wunreachable-code-return)
AC_LBL_CHECK_COMPILER_OPT($1, -Wused-but-marked-unused)
diff --git a/configure b/configure
index b76db520..25ffe864 100755
--- a/configure
+++ b/configure
@@ -7135,6 +7135,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 -Wsign-compare option" >&5
+$as_echo_n "checking whether the compiler supports the -Wsign-compare option... " >&6; }
+ save_CFLAGS="$CFLAGS"
+ if expr "x-Wsign-compare" : "x-W.*" >/dev/null
+ then
+ CFLAGS="$CFLAGS $ac_lbl_unknown_warning_option_error -Wsign-compare"
+ elif expr "x-Wsign-compare" : "x-f.*" >/dev/null
+ then
+ CFLAGS="$CFLAGS -Werror -Wsign-compare"
+ elif expr "x-Wsign-compare" : "x-m.*" >/dev/null
+ then
+ CFLAGS="$CFLAGS -Werror -Wsign-compare"
+ else
+ CFLAGS="$CFLAGS -Wsign-compare"
+ 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 -Wsign-compare"
+
+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 -Wstrict-prototypes option" >&5
$as_echo_n "checking whether the compiler supports the -Wstrict-prototypes option... " >&6; }
save_CFLAGS="$CFLAGS"