log.h: Avoid unnecessary GNU extension for token pasting

clang says:

  ./log.h:23:18: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]

We need token pasting here just because of the 'format' in trace():
drop it.

Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2022-10-12 17:31:37 +02:00
parent 55cdcc159b
commit 7f2a7396e2

4
log.h
View file

@ -17,10 +17,10 @@ void debug(const char *format, ...);
extern int log_trace; extern int log_trace;
void trace_init(int enable); void trace_init(int enable);
#define trace(format, ...) \ #define trace(...) \
do { \ do { \
if (log_trace) \ if (log_trace) \
debug(format, ##__VA_ARGS__); \ debug(__VA_ARGS__); \
} while (0) } while (0)
void __openlog(const char *ident, int option, int facility); void __openlog(const char *ident, int option, int facility);