Skip to content

Commit 66955c8

Browse files
dcpleungkartben
authored andcommitted
toolchain: xt-clang: skip printf format checks
For some reasons, xt-clang does not like "%hhd" or "%hd" (for example) being fed int data (same goes for unsigned ones) and will always complain about mismatched types. GCC and newer LLVM/Clang do not complain. This could be due to xt-clang being based on older LLVM/Clang. So skip the check. Fixes: #89008 Signed-off-by: Daniel Leung <[email protected]>
1 parent 2102246 commit 66955c8

File tree

1 file changed

+13
-0
lines changed
  • include/zephyr/toolchain

1 file changed

+13
-0
lines changed

include/zephyr/toolchain/xcc.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@
4242
#include <zephyr/toolchain/gcc.h>
4343
#endif
4444

45+
#ifdef __clang__
46+
/* For some reasons, xt-clang does not like "%hhd" or "%hd" (for example)
47+
* being fed int data (same goes for unsigned ones) and will always complain
48+
* about mismatched types. GCC and newer LLVM/Clang do not complain.
49+
* This could be due to xt-clang being based on older LLVM/Clang.
50+
* So skip the check.
51+
*/
52+
#ifdef __printf_like
53+
#undef __printf_like
54+
#define __printf_like(f, a)
55+
#endif
56+
#endif
57+
4558
#ifndef __clang__
4659
#undef __BYTE_ORDER__
4760
#endif

0 commit comments

Comments
 (0)