summaryrefslogtreecommitdiffstats
path: root/include/libipset/debug.h
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@netfilter.org>2021-02-17 10:07:27 +0100
committerJozsef Kadlecsik <kadlec@netfilter.org>2021-02-19 21:20:58 +0100
commitcd5ede17e535a21414c455e54dc1baef9c3f34b8 (patch)
treebf964dfa05483316757ff2e0b1e121dfdd33862e /include/libipset/debug.h
parentb031a4db2237503d370624cfc9573ead7438fddf (diff)
Silence unused-but-set-variable warnings
When ipset is compiled in non-debug mode, in some environments warnings treated as errors emitted: session.c: In function 'build_msg': session.c:1985:28: warning: variable 'type' set but not used [-Wunused-but-set-variable] const struct ipset_type *type; ^ session.c:2030:28: warning: variable 'type' set but not used [-Wunused-but-set-variable] const struct ipset_type *type; ^ Fix it by hiding the unused variable definitions/settings in non-debug mode. Reported by Serhey Popovych. Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Diffstat (limited to 'include/libipset/debug.h')
-rw-r--r--include/libipset/debug.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/libipset/debug.h b/include/libipset/debug.h
index 9743d59..92d5f89 100644
--- a/include/libipset/debug.h
+++ b/include/libipset/debug.h
@@ -11,6 +11,7 @@
#include <stdio.h>
#include <sys/socket.h>
#include <linux/netlink.h>
+#define DD(cmd) cmd
#define D(fmt, args...) \
fprintf(stderr, "%s: %s: " fmt "\n", __FILE__, __func__ , ## args)
#define IF_D(test, fmt, args...) \
@@ -25,6 +26,7 @@ dump_nla(struct nlattr *nla[], int maxlen)
D("nla[%u] does%s exist", i, nla[i] ? "" : " NOT");
}
#else
+#define DD(cmd)
#define D(fmt, args...)
#define IF_D(test, fmt, args...)
#define dump_nla(nla, maxlen)