Add -Wpointer-arith to warning and checking builds
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Wed, 21 Oct 2009 23:34:50 +0000 (00:34 +0100)
committerDerrick Brashear <shadow|account-1000005@unknown>
Thu, 22 Oct 2009 02:54:32 +0000 (19:54 -0700)
GCC doesn't catch issues with performing pointer arithmetic on
(void *)s, unless the -Wpointer-arith warning flags is supplied.
Enable it for warning and checking builds.

Reviewed-on: http://gerrit.openafs.org/708
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/cf/osconf.m4

index ee07232..c61a57d 100644 (file)
@@ -1184,10 +1184,10 @@ CFLAGS_NOERROR=
 
 if test "x$GCC" = "xyes"; then
   if test "x$enable_warnings" = "xyes"; then
-    XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition"
+    XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Wpointer-arith"
   fi
   if test "x$enable_checking" != "xno"; then
-    XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Werror -fdiagnostics-show-option"
+    XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Werror -fdiagnostics-show-option -Wpointer-arith"
     if test "x$enable_checking" != "xall"; then
       CFLAGS_NOERROR="-Wno-error"
       AC_DEFINE(IGNORE_SOME_GCC_WARNINGS, 1, [define to disable some gcc warnings in warnings-as-errors mode])