From: Tobias Brunner Date: Mon, 1 May 2023 08:44:42 +0000 (+0200) Subject: debug: Add macro to mark variables that are only used in DBG statements X-Git-Tag: 5.9.11rc1~12^2~52 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=2d4a98d0d33f688378612531c52d965513f7bc96;p=thirdparty%2Fstrongswan.git debug: Add macro to mark variables that are only used in DBG statements Some variables that are only assigned to be used in DBG statements will otherwise trigger a "set but not used" warning/error if DEBUG_LEVEL is too low. --- diff --git a/src/libstrongswan/utils/debug.h b/src/libstrongswan/utils/debug.h index 127da579a1..06d43ebbff 100644 --- a/src/libstrongswan/utils/debug.h +++ b/src/libstrongswan/utils/debug.h @@ -140,6 +140,11 @@ enum level_t { # define DBG4(...) {} #endif +/** mark variables that are only used in DBG statements */ +#ifndef DBG_UNUSED +# define DBG_UNUSED __attribute__((unused)) +#endif + /** dbg function hook, uses dbg_default() by default */ extern void (*dbg) (debug_t group, level_t level, char *fmt, ...);