]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
debug: Add macro to mark variables that are only used in DBG statements
authorTobias Brunner <tobias@strongswan.org>
Mon, 1 May 2023 08:44:42 +0000 (10:44 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 8 May 2023 09:51:10 +0000 (11:51 +0200)
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

index 127da579a13c3b19afb0053f8d9365179e1e1074..06d43ebbff237ba663c08d7fc4e33e21b5d8be1d 100644 (file)
@@ -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, ...);