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.
This commit is contained in:
Tobias Brunner
2023-05-08 11:51:10 +02:00
parent 7b453ae409
commit 2d4a98d0d3
+5
View 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, ...);