From 633aaaf0f30a6eb8d59eb066d3e9e9e92bce4fd1 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Thu, 10 May 2012 10:29:22 +0200 Subject: [PATCH] Add more CC warning option to debug mode --- configure.ac | 7 +++++++ include/libipset/data.h | 4 ++-- lib/ipset_bitmap_ip.c | 1 + lib/ipset_bitmap_ipmac.c | 1 + lib/ipset_bitmap_port.c | 1 + lib/ipset_hash_ip.c | 1 + lib/ipset_hash_ipport.c | 1 + lib/ipset_hash_ipportip.c | 1 + lib/ipset_hash_ipportnet.c | 1 + lib/ipset_hash_net.c | 1 + lib/ipset_hash_netiface.c | 1 + lib/ipset_hash_netport.c | 1 + lib/ipset_list_set.c | 1 + 13 files changed, 20 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index eae4295..3789cf0 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 5d80185..b7e7747 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 8290803..fae3d81 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 6f51293..9f591cd 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 de02e50..7b1f839 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 40f684f..6a03d38 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 c9c3b60..5e80084 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 ac6182b..f99d85f 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 6750208..5a2d97c 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 bab33e2..789bcd2 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 e60acbf..bc6aa3d 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 285f06c..e638756 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 dc0bf53..69a1379 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); -- 2.40.0