From 2d4a98d0d33f688378612531c52d965513f7bc96 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 1 May 2023 10:44:42 +0200 Subject: [PATCH] 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. --- src/libstrongswan/utils/debug.h | 5 +++++ 1 file changed, 5 insertions(+) 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, ...); -- 2.47.2