From: Rusty Russell Date: Tue, 22 Mar 2011 01:21:00 +0000 (+1030) Subject: ccan: add -Wpointer-arith and -Wwrite-strings by default X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=a95fc43fbef22efa0a41b3ce86a732bb57ad9ef5 ccan: add -Wpointer-arith and -Wwrite-strings by default 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). --- diff --git a/Makefile-ccan b/Makefile-ccan index 22f1bbe5..ba83f4ae 100644 --- a/Makefile-ccan +++ b/Makefile-ccan @@ -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 diff --git a/config.h b/config.h index 682b4ce2..b0e5b02a 100644 --- 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