-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KEIL AC6编译警告!!! #64
Comments
请问解决了吗 |
全部改成宏定义解决 |
我也碰到同样的问题.....能详细说一下解决方案吗?? |
|
3Q......这也是一种思路。 |
我发现,就算用宏定义清除了警告。。。在AC6上还是不正常,打印出来的信息不正常。。。 |
解决方案:Option for Targets -> C/C++(AC6) -> Misc Controls -> -Wno-format-security |
为了支持中文显示搞的东西,这种库完全没有必要支持中文显示。我给清理了一下,去掉了中文支持,兼容了C89,剩4个文件,解压后丢到自己的工程中即可。很好用,不需要文档,直接看代码即可。 |
或许跟编码格式有关系,使用GB2312的中文可能不正常.UTF8格式的中文试一下或许可以 |
环境:KEIL5.29
编译器:AC6.13.1
FreeRTOS: V10.4.6,task.c中已增加uxSizeOfStack
cmb_cfg.h:
#define cmb_println(...) printf(VA_ARGS);printf("\r\n");/* e.g., printf(VA_ARGS);printf("\r\n") */
#define CMB_USING_OS_PLATFORM
#define CMB_OS_PLATFORM_TYPE CMB_OS_PLATFORM_FREERTOS
#define CMB_CPU_PLATFORM_TYPE CMB_CPU_ARM_CORTEX_M4
/* enable dump stack information /
#define CMB_USING_DUMP_STACK_INFO
/ language of print information */
#define CMB_PRINT_LANGUAGE CMB_PRINT_LANGUAGE_ENGLISH // (default) or CMB_PRINT_LANGUAGE_CHINESE */
编译出现30个警告:
cm_backtrace.c(168): warning: format string is not a string literal (potentially insecure) [-Wformat-security]
cmb_println(print_info[PRINT_MAIN_STACK_CFG_ERROR]);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cmb_cfg.h(35): note: expanded from macro 'cmb_println'
#define cmb_println(...) printf(VA_ARGS);printf("\r\n");/* e.g., printf(VA_ARGS);printf("\r\n") /
^~~~~~~~~~~
cm_backtrace.c(168): note: treat the string as an argument to avoid this
cmb_println(print_info[PRINT_MAIN_STACK_CFG_ERROR]);
^
"%s",
cmb_cfg.h(35): note: expanded from macro 'cmb_println'
#define cmb_println(...) printf(VA_ARGS);printf("\r\n");/ e.g., printf(VA_ARGS);printf("\r\n") /
^
cm_backtrace.c(256): warning: format string is not a string literal (potentially insecure) [-Wformat-security]
cmb_println(print_info[PRINT_THREAD_STACK_INFO]);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cmb_cfg.h(35): note: expanded from macro 'cmb_println'
#define cmb_println(...) printf(VA_ARGS);printf("\r\n");/ e.g., printf(VA_ARGS);printf("\r\n") */
^~~~~~~~~~~
../Middlewares/CmBacktrace/cm_backtrace/cm_backtrace.c(256): note: treat the string as an argument to avoid this
……
有什么办法可以消除这些警告吗????@armink
The text was updated successfully, but these errors were encountered: