summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-04-26 18:50:49 -0700
committerGuy Harris <guy@alum.mit.edu>2015-04-26 18:50:49 -0700
commita1fa7a0114659803bf12252b929621c9e5ad6df1 (patch)
treee352435ccc19fcbd211e9cf770ddf461fd935bbd /configure
parentdccbbf9a09fe917311400196b9a3542831b12598 (diff)
downloadtcpdump-a1fa7a0114659803bf12252b929621c9e5ad6df1.tar.gz
Compile with -Wcast-qual.
That let me find what might have been the bulk of the 579(!) instances of "Deconst" reported in http://www.cl.cam.ac.uk/~dc552/papers/asplos15-memory-safe-c.pdf and, hopefully, will prevent more from creeping in. There are some remaining ones - and they represent attempts to overwrite the packet bytes handed to tcpdump by libpcap, which could well *fail* with, for example, memory-mapped capture mechanisms!
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure32
1 files changed, 32 insertions, 0 deletions
diff --git a/configure b/configure
index 43b3068a..268d487a 100755
--- a/configure
+++ b/configure
@@ -7811,6 +7811,38 @@ 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 -Wcast-qual option" >&5
+$as_echo_n "checking whether the compiler supports the -Wcast-qual option... " >&6; }
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors -Wcast-qual"
+ 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 -Wcast-qual"
+
+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 -W option" >&5
$as_echo_n "checking whether the compiler supports the -W option... " >&6; }
save_CFLAGS="$CFLAGS"