diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-04-26 18:50:49 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-04-26 18:50:49 -0700 |
commit | a1fa7a0114659803bf12252b929621c9e5ad6df1 (patch) | |
tree | e352435ccc19fcbd211e9cf770ddf461fd935bbd /configure | |
parent | dccbbf9a09fe917311400196b9a3542831b12598 (diff) | |
download | tcpdump-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-x | configure | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -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" |