Skip to content

KEIL AC6编译警告!!! #64

Description

@libangy

环境: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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions