Skip to main content
MBel.1
Visitor II
July 9, 2020
Question

STM32CUBE IDE FreeRTOS cmsis_os.h:461:67: warning: ISO C++ forbids converting a string constant to 'char*'

  • July 9, 2020
  • 0 replies
  • 922 views

When freeRTOS header cmsis_os.h is used in *.cpp file, it generates compiler warning

ISO C++ forbids converting a string constant to 'char*'.

Proposed fix:

Change line 326 of cmsis_os.h from:

typedef struct os_thread_def {

 char                  *name;       ///< Thread name

to:

typedef struct os_thread_def {

const char            *name;       ///< Thread name

This topic has been closed for replies.