CFLAGS="$CFLAGS -W -Wfloat-equal -Wundef -Wpointer-arith"
CFLAGS="$CFLAGS -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings"
CFLAGS="$CFLAGS -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2"
- CFLAGS="$CFLAGS -Wwrite-strings -Wmissing-declarations -Wredundant-decls"
+ CFLAGS="$CFLAGS -Wwrite-strings"
CFLAGS="$CFLAGS -Wnested-externs -Wbad-function-cast -Wswitch-enum"
-
- # Disabled, so we can use mallinfo(): -Waggregate-return
-
- if test "x$have_gcc4" = "xyes"; then
- # These warnings break gcc 3.3.5 and work on gcc 4.0.2
- CFLAGS="$CFLAGS -Winit-self -Wmissing-field-initializers -Wold-style-definition"
- fi
-
- if test "x$have_gcc42" = "xyes"; then
- # These warnings break gcc 4.0.2 and work on gcc 4.2
- CFLAGS="$CFLAGS -Waddress -Wmissing-noreturn -Wstrict-overflow=1"
-
- # We used to use -Wstrict-overflow=5, but that breaks us heavily under 4.3.
- fi
-
- if test "x$have_gcc42" = "xyes" && test "x$have_clang" = "xno"; then
- # These warnings break gcc 4.0.2 and clang, but work on gcc 4.2
- CFLAGS="$CFLAGS -Wnormalized=id -Woverride-init"
- fi
-
- if test "x$have_gcc43" = "xyes"; then
- # These warnings break gcc 4.2 and work on gcc 4.3
- CFLAGS="$CFLAGS -Wextra -Warray-bounds"
- fi
-
- if test "x$have_gcc46" = "xyes"; then
- # This warning was added in gcc 4.3, but it appears to generate
- # spurious warnings in gcc 4.4. I don't know if it works in 4.5.
- CFLAGS="$CFLAGS -Wlogical-op"
- fi
-
- if test "x$have_shorten64_flag" = "xyes"; then
- CFLAGS="$CFLAGS -Wshorten-64-to-32"
+ CFLAGS="$CFLAGS -Waggregate-return -Wpacked -Wunused"
+ CFLAGS="$CFLAGS -Wunused-parameter "
+ # These interfere with building main() { return 0; }, which autoconf
+ # likes to use as its default program.
+ CFLAGS="$CFLAGS -Wold-style-definition -Wmissing-declarations"
+
+ if test "$tor_cv_cflags__Wnull_dereference" = "yes"; then
+ AC_DEFINE([HAVE_CFLAG_WNULL_DEREFERENCE], 1, [True if we have -Wnull-dereference])
fi
- if test "$tor_cv_cflags__Woverlength_strings" = "yes"; then
- AC_DEFINE([HAVE_CFLAG_WOVERLENGTH_STRINGS], 1, [True if we have -Woverlength-strings])
- fi
if test "x$enable_fatal_warnings" = "xyes"; then
# I'd like to use TOR_CHECK_CFLAGS here, but I can't, since the