Skip to content

Commit 3c9e059

Browse files
Christoph Schnetzleraescolar
authored andcommitted
logging: cmsis: prevent wundef warnings
If -Werror is used compilation fails due to wundef warning. Signed-off-by: Christoph Schnetzler <[email protected]>
1 parent 563ef0d commit 3c9e059

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

include/zephyr/logging/log_core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static inline char z_log_minimal_level_to_char(int level)
197197
* emitted instead. String check may increase compilation time so it is not
198198
* always performed (could significantly increase CI time).
199199
*/
200-
#if CONFIG_LOG_FMT_STRING_VALIDATE
200+
#if defined(CONFIG_LOG_FMT_STRING_VALIDATE) && CONFIG_LOG_FMT_STRING_VALIDATE
201201
#define LOG_STRING_WARNING(_mode, _src, ...) \
202202
Z_LOG_MSG_CREATE(UTIL_NOT(IS_ENABLED(CONFIG_USERSPACE)), _mode, \
203203
Z_LOG_LOCAL_DOMAIN_ID, _src, LOG_LEVEL_ERR, NULL, 0, \

modules/cmsis/cmsis_core_m.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@
5252
#error "__DSP_PRESENT and CONFIG_ARMV8_M_DSP are not set to the same value"
5353
#endif
5454

55-
#if __ICACHE_PRESENT != CONFIG_CPU_HAS_ICACHE
55+
#if defined(__ICACHE_PRESENT) && (__ICACHE_PRESENT != CONFIG_CPU_HAS_ICACHE)
5656
#error "__ICACHE_PRESENT and CONFIG_CPU_HAS_ICACHE are not set to the same value"
5757
#endif
5858

59-
#if __DCACHE_PRESENT != CONFIG_CPU_HAS_DCACHE
59+
#if defined(__DCACHE_PRESENT) && (__DCACHE_PRESENT != CONFIG_CPU_HAS_DCACHE)
6060
#error "__DCACHE_PRESENT and CONFIG_CPU_HAS_DCACHE are not set to the same value"
6161
#endif
6262

63-
#if __MVE_PRESENT != CONFIG_ARMV8_1_M_MVEI
63+
#if defined(__MVE_PRESENT) && (__MVE_PRESENT != CONFIG_ARMV8_1_M_MVEI)
6464
#error "__MVE_PRESENT and CONFIG_ARMV8_1_M_MVEI are not set to the same value"
6565
#endif
6666

67-
#if __SAUREGION_PRESENT != CONFIG_CPU_HAS_ARM_SAU
67+
#if defined(__SAUREGION_PRESENT) && (__SAUREGION_PRESENT != CONFIG_CPU_HAS_ARM_SAU)
6868
#error "__SAUREGION_PRESENT and CONFIG_CPU_HAS_ARM_SAU are not set to the same value"
6969
#endif
7070

0 commit comments

Comments
 (0)