1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

core, log: fix tautology compare error with toolchain llvm

This commit is contained in:
smlng 2017-03-06 22:29:26 +01:00
parent f839e73b1a
commit 1b69f281f9

View File

@ -73,7 +73,16 @@ enum {
/**
* @brief Log message if level <= LOG_LEVEL
*/
#define LOG(level, ...) if (level <= LOG_LEVEL) log_write(level, __VA_ARGS__)
#ifdef __clang__ /* following pragmas required for clang 3.8.0 */
#define LOG(level, ...) do { \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wtautological-compare\"") \
if ((level) <= LOG_LEVEL) log_write((level), __VA_ARGS__); } while (0U) \
_Pragma("clang diagnostic pop")
#else
#define LOG(level, ...) do { \
if ((level) <= LOG_LEVEL) log_write((level), __VA_ARGS__); } while (0U)
#endif /* __clang__ */
/**
* @brief logging convenience defines