From: Jozsef Kadlecsik Date: Thu, 10 May 2012 08:29:22 +0000 (+0200) Subject: Add more CC warning option to debug mode X-Git-Tag: v6.12.1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=633aaaf0f30a6eb8d59eb066d3e9e9e92bce4fd1;p=thirdparty%2Fipset.git Add more CC warning option to debug mode --- diff --git a/configure.ac b/configure.ac index eae42958..3789cf0e 100644 --- a/configure.ac +++ b/configure.ac @@ -172,6 +172,7 @@ dnl Check extra warning flags except dnl -Wconversion -> we need it dnl -Wunreachable-code -> fails with ntoh* dnl -Wpointer-arith -> limbnl uses it +dnl -Wsign-conversion -> libmnl if test "x$enable_debug" = "xyes" then AX_CFLAGS_GCC_OPTION(-Waggregate-return) @@ -182,22 +183,28 @@ AX_CFLAGS_GCC_OPTION(-Werror) AX_CFLAGS_GCC_OPTION(-Wextra) AX_CFLAGS_GCC_OPTION(-Wfloat-equal) AX_CFLAGS_GCC_OPTION(-Wformat=2) +AX_CFLAGS_GCC_OPTION(-Wjump-misses-init) AX_CFLAGS_GCC_OPTION(-Winit-self) AX_CFLAGS_GCC_OPTION(-Winline) +AX_CFLAGS_GCC_OPTION(-Wlogical-op) AX_CFLAGS_GCC_OPTION(-Wmissing-declarations) AX_CFLAGS_GCC_OPTION(-Wmissing-format-attribute) AX_CFLAGS_GCC_OPTION(-Wmissing-prototypes) AX_CFLAGS_GCC_OPTION(-Wnested-externs) AX_CFLAGS_GCC_OPTION(-Wno-missing-field-initializers) +AX_CFLAGS_GCC_OPTION(-Wold-style-definition) AX_CFLAGS_GCC_OPTION(-Woverlength-strings) AX_CFLAGS_GCC_OPTION(-Wpacked) AX_CFLAGS_GCC_OPTION(-Wredundant-decls) +AX_CFLAGS_GCC_OPTION(-Wrwrite-strings) AX_CFLAGS_GCC_OPTION(-Wshadow) AX_CFLAGS_GCC_OPTION(-Wsign-compare) AX_CFLAGS_GCC_OPTION(-Wstrict-prototypes) AX_CFLAGS_GCC_OPTION(-Wswitch-default) AX_CFLAGS_GCC_OPTION(-Wundef) +AX_CFLAGS_GCC_OPTION(-Wuninitialized) AX_CFLAGS_GCC_OPTION(-Wunused) +AX_CFLAGS_GCC_OPTION(-Wvla) AX_CFLAGS_GCC_OPTION(-Wwrite-strings) fi dnl Checks for library functions. diff --git a/include/libipset/data.h b/include/libipset/data.h index 5d801852..b7e7747f 100644 --- a/include/libipset/data.h +++ b/include/libipset/data.h @@ -65,8 +65,8 @@ enum ipset_opt { IPSET_OPT_MAX, }; -#define IPSET_FLAG(opt) (1LL << (opt)) -#define IPSET_FLAGS_ALL (~0LL) +#define IPSET_FLAG(opt) (1ULL << (opt)) +#define IPSET_FLAGS_ALL (~0ULL) #define IPSET_CREATE_FLAGS \ (IPSET_FLAG(IPSET_OPT_FAMILY) \ diff --git a/lib/ipset_bitmap_ip.c b/lib/ipset_bitmap_ip.c index 8290803a..fae3d81e 100644 --- a/lib/ipset_bitmap_ip.c +++ b/lib/ipset_bitmap_ip.c @@ -96,6 +96,7 @@ static struct ipset_type ipset_bitmap_ip0 = { .usage = bitmap_ip_usage, }; +void _init(void); void _init(void) { ipset_type_add(&ipset_bitmap_ip0); diff --git a/lib/ipset_bitmap_ipmac.c b/lib/ipset_bitmap_ipmac.c index 6f512936..9f591cd2 100644 --- a/lib/ipset_bitmap_ipmac.c +++ b/lib/ipset_bitmap_ipmac.c @@ -99,6 +99,7 @@ static struct ipset_type ipset_bitmap_ipmac0 = { .usage = bitmap_ipmac_usage, }; +void _init(void); void _init(void) { ipset_type_add(&ipset_bitmap_ipmac0); diff --git a/lib/ipset_bitmap_port.c b/lib/ipset_bitmap_port.c index de02e505..7b1f8392 100644 --- a/lib/ipset_bitmap_port.c +++ b/lib/ipset_bitmap_port.c @@ -86,6 +86,7 @@ static struct ipset_type ipset_bitmap_port0 = { .usage = bitmap_port_usage, }; +void _init(void); void _init(void) { ipset_type_add(&ipset_bitmap_port0); diff --git a/lib/ipset_hash_ip.c b/lib/ipset_hash_ip.c index 40f684f2..6a03d38b 100644 --- a/lib/ipset_hash_ip.c +++ b/lib/ipset_hash_ip.c @@ -118,6 +118,7 @@ static struct ipset_type ipset_hash_ip0 = { .usage = hash_ip_usage, }; +void _init(void); void _init(void) { ipset_type_add(&ipset_hash_ip0); diff --git a/lib/ipset_hash_ipport.c b/lib/ipset_hash_ipport.c index c9c3b600..5e80084d 100644 --- a/lib/ipset_hash_ipport.c +++ b/lib/ipset_hash_ipport.c @@ -143,6 +143,7 @@ static struct ipset_type ipset_hash_ipport1 = { .usagefn = ipset_port_usage, }; +void _init(void); void _init(void) { ipset_type_add(&ipset_hash_ipport1); diff --git a/lib/ipset_hash_ipportip.c b/lib/ipset_hash_ipportip.c index ac6182bc..f99d85fa 100644 --- a/lib/ipset_hash_ipportip.c +++ b/lib/ipset_hash_ipportip.c @@ -154,6 +154,7 @@ static struct ipset_type ipset_hash_ipportip1 = { .usagefn = ipset_port_usage, }; +void _init(void); void _init(void) { ipset_type_add(&ipset_hash_ipportip1); diff --git a/lib/ipset_hash_ipportnet.c b/lib/ipset_hash_ipportnet.c index 67502084..5a2d97c4 100644 --- a/lib/ipset_hash_ipportnet.c +++ b/lib/ipset_hash_ipportnet.c @@ -357,6 +357,7 @@ static struct ipset_type ipset_hash_ipportnet3 = { .usagefn = ipset_port_usage, }; +void _init(void); void _init(void) { ipset_type_add(&ipset_hash_ipportnet1); diff --git a/lib/ipset_hash_net.c b/lib/ipset_hash_net.c index bab33e22..789bcd2a 100644 --- a/lib/ipset_hash_net.c +++ b/lib/ipset_hash_net.c @@ -229,6 +229,7 @@ static struct ipset_type ipset_hash_net2 = { .usage = hash_net2_usage, }; +void _init(void); void _init(void) { ipset_type_add(&ipset_hash_net0); diff --git a/lib/ipset_hash_netiface.c b/lib/ipset_hash_netiface.c index e60acbfc..bc6aa3dd 100644 --- a/lib/ipset_hash_netiface.c +++ b/lib/ipset_hash_netiface.c @@ -200,6 +200,7 @@ static struct ipset_type ipset_hash_netiface1 = { .usage = hash_netiface1_usage, }; +void _init(void); void _init(void) { ipset_type_add(&ipset_hash_netiface0); diff --git a/lib/ipset_hash_netport.c b/lib/ipset_hash_netport.c index 285f06c3..e638756b 100644 --- a/lib/ipset_hash_netport.c +++ b/lib/ipset_hash_netport.c @@ -287,6 +287,7 @@ static struct ipset_type ipset_hash_netport3 = { .usagefn = ipset_port_usage, }; +void _init(void); void _init(void) { ipset_type_add(&ipset_hash_netport1); diff --git a/lib/ipset_list_set.c b/lib/ipset_list_set.c index dc0bf535..69a1379c 100644 --- a/lib/ipset_list_set.c +++ b/lib/ipset_list_set.c @@ -90,6 +90,7 @@ static struct ipset_type ipset_list_set0 = { .usage = list_set_usage, }; +void _init(void); void _init(void) { ipset_type_add(&ipset_list_set0);