diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2011-01-18 17:48:22 +0100 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2011-01-18 17:48:22 +0100 |
commit | 712154704964906a59d481dc7edf43554f9eaf83 (patch) | |
tree | 0d757fa52642ff6cc4239f81a28bdc3d19146a7c /lib | |
parent | 7ba43e68db3e61e0e8c13d5189f153a06954259d (diff) |
Fix build with NDEBUG defined
The usage of the gcc option -Wunused-parameter interferes badly with
the assert() macros. In case -DNDEBUG is specified build fails with:
cc1: warnings being treated as errors
print.c: In function 'ipset_print_family':
print.c:92: error: unused parameter 'opt'
print.c: In function 'ipset_print_port':
print.c:413: error: unused parameter 'opt'
print.c: In function 'ipset_print_proto':
Fix it by taking into accout NDEBUG in the function arguments.
Bug reported by Holger Eitzenberger.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/parse.c | 4 | ||||
-rw-r--r-- | lib/print.c | 18 |
2 files changed, 14 insertions, 8 deletions
diff --git a/lib/parse.c b/lib/parse.c index fbc1dca..e998df5 100644 --- a/lib/parse.c +++ b/lib/parse.c @@ -845,7 +845,7 @@ ipset_parse_net(struct ipset_session *session, */ int ipset_parse_range(struct ipset_session *session, - enum ipset_opt opt, const char *str) + enum ipset_opt opt ASSERT_UNUSED, const char *str) { assert(session); assert(opt == IPSET_OPT_IP || opt == IPSET_OPT_IP2); @@ -1322,7 +1322,7 @@ ipset_parse_flag(struct ipset_session *session, */ int ipset_parse_typename(struct ipset_session *session, - enum ipset_opt opt, const char *str) + enum ipset_opt opt ASSERT_UNUSED, const char *str) { const struct ipset_type *type; const char *typename; diff --git a/lib/print.c b/lib/print.c index b6819e5..7ec786f 100644 --- a/lib/print.c +++ b/lib/print.c @@ -89,7 +89,8 @@ ipset_print_ether(char *buf, unsigned int len, */ int ipset_print_family(char *buf, unsigned int len, - const struct ipset_data *data, enum ipset_opt opt, + const struct ipset_data *data, + enum ipset_opt opt ASSERT_UNUSED, uint8_t env UNUSED) { uint8_t family; @@ -410,7 +411,8 @@ ipset_print_name(char *buf, unsigned int len, */ int ipset_print_port(char *buf, unsigned int len, - const struct ipset_data *data, enum ipset_opt opt, + const struct ipset_data *data, + enum ipset_opt opt ASSERT_UNUSED, uint8_t env UNUSED) { const uint16_t *port; @@ -454,7 +456,8 @@ ipset_print_port(char *buf, unsigned int len, */ int ipset_print_proto(char *buf, unsigned int len, - const struct ipset_data *data, enum ipset_opt opt, + const struct ipset_data *data, + enum ipset_opt opt ASSERT_UNUSED, uint8_t env UNUSED) { const struct protoent *protoent; @@ -490,7 +493,8 @@ ipset_print_proto(char *buf, unsigned int len, */ int ipset_print_icmp(char *buf, unsigned int len, - const struct ipset_data *data, enum ipset_opt opt, + const struct ipset_data *data, + enum ipset_opt opt ASSERT_UNUSED, uint8_t env UNUSED) { const char *name; @@ -523,7 +527,8 @@ ipset_print_icmp(char *buf, unsigned int len, */ int ipset_print_icmpv6(char *buf, unsigned int len, - const struct ipset_data *data, enum ipset_opt opt, + const struct ipset_data *data, + enum ipset_opt opt ASSERT_UNUSED, uint8_t env UNUSED) { const char *name; @@ -556,7 +561,8 @@ ipset_print_icmpv6(char *buf, unsigned int len, */ int ipset_print_proto_port(char *buf, unsigned int len, - const struct ipset_data *data, enum ipset_opt opt, + const struct ipset_data *data, + enum ipset_opt opt ASSERT_UNUSED, uint8_t env UNUSED) { int size, offset = 0; |