]> git.ozlabs.org Git - ccan/commitdiff
ccan: add -Wpointer-arith and -Wwrite-strings by default
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 22 Mar 2011 01:21:00 +0000 (11:51 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 22 Mar 2011 01:21:00 +0000 (11:51 +1030)
Wpointer-arith is useful for spotting GCC-isms which do arithmetic on
void pointers.  Wwrite-strings treats string constants as const char *,
which is sane (but bad for legacy code).

Makefile-ccan
config.h

index 22f1bbe5d7016637f844e5aab69a3eb196e91d30..ba83f4ae6ca45b02e574015f0251d207bd909c17 100644 (file)
@@ -3,7 +3,7 @@
 #      SRCFILES += $(wildcard ccan/*/*.c)
 
 #CCAN_CFLAGS=-g -O3 -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations
-CCAN_CFLAGS=-g -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -DCCAN_STR_DEBUG=1
+CCAN_CFLAGS=-g -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wwrite-strings -DCCAN_STR_DEBUG=1
 CFLAGS = $(CCAN_CFLAGS) -I. $(DEPGEN) -Werror
 
 
index 682b4ce230fe479af6e64aa4f8572fe6095a637a..b0e5b02a3428874f89b7d6219ffcaf3d44dd6996 100644 (file)
--- a/config.h
+++ b/config.h
@@ -3,7 +3,7 @@
 #define CCAN_CONFIG_H
 #define _GNU_SOURCE /* Always use GNU extensions. */
 #define CCAN_COMPILER "cc"
-#define CCAN_CFLAGS "-g -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -DCCAN_STR_DEBUG=1"
+#define CCAN_CFLAGS "-g -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wwrite-strings -DCCAN_STR_DEBUG=1"
 
 #define HAVE_ALIGNOF 1
 #define HAVE_ASPRINTF 1