]> git.ipfire.org Git - thirdparty/ipset.git/commit
Silence unused-but-set-variable warnings
authorJozsef Kadlecsik <kadlec@netfilter.org>
Wed, 17 Feb 2021 09:07:27 +0000 (10:07 +0100)
committerJozsef Kadlecsik <kadlec@netfilter.org>
Fri, 19 Feb 2021 20:20:58 +0000 (21:20 +0100)
commitcd5ede17e535a21414c455e54dc1baef9c3f34b8
treebf964dfa05483316757ff2e0b1e121dfdd33862e
parentb031a4db2237503d370624cfc9573ead7438fddf
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>
include/libipset/debug.h
lib/session.c