提交 d2e6715d 编写于 作者: W weycen 提交者: Bernard Xiong

[kernel] Add __attribute__(...) for rt_kprintf() to let the compiler check the...

[kernel] Add __attribute__(...) for rt_kprintf() to let the compiler check the format string parameters

Tested in the following environment:
1. Keil uVersion:Arm Compiler v5.06、v6.7、v6.16  
2. Atollic TrueSTUDIO for STM32:GNU v6.3.1  
3. Code Composer Studio:TI Compiler v20.2.2.LTS、GNU v7.2.1
上级 88a74637
......@@ -570,7 +570,12 @@ void rt_components_board_init(void);
#define rt_kprintf(...)
#define rt_kputs(str)
#else
#if defined(__ARMCC_VERSION) || defined(__GNUC__) || \
defined(__TI_COMPILER_VERSION__)
int rt_kprintf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
#else
int rt_kprintf(const char *fmt, ...);
#endif
void rt_kputs(const char *str);
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册