From 712154704964906a59d481dc7edf43554f9eaf83 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Tue, 18 Jan 2011 17:48:22 +0100 Subject: 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. --- include/libipset/utils.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/libipset/utils.h b/include/libipset/utils.h index c22687f..2c88a83 100644 --- a/include/libipset/utils.h +++ b/include/libipset/utils.h @@ -25,6 +25,11 @@ #define MAX(a, b) (a > b ? a : b) #define UNUSED __attribute__ ((unused)) +#ifdef NDEBUG +#define ASSERT_UNUSED UNUSED +#else +#define ASSERT_UNUSED +#endif #ifndef ARRAY_SIZE #define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x))) -- cgit v1.2.3