-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Currently, the logging macros are defined as:
#define poco_error(logger, msg) \
if ((logger).error()) (logger).error(msg, _FILE_, __LINE__); else (void) 0
This can cause compiler warnings if used in an if statement.
Possible alternative implementations:
// works but generates warning
#define poco_error(logger, msg) \
do { if ((logger).error()) (logger).error(msg, _FILE_, __LINE__); } while(0)
#define poco_error(logger, msg) \
for( ; ; ) { if ((logger).error()) (logger).error(msg, _FILE_, __LINE__); break;}
Reactions are currently unavailable