Showing results for 
Search instead for 
Did you mean: 

Why does a fresh CubeIDE project including RTOS produce 50 compilation warnings?

Associate II


I just created a fresh project in STM32CubeIDE for STM32L496ZGTxP and included FREERTOS with CubeMX and left everything at its default setting for the time being. After generating the code and compiling, I get 50 compiler warnings. All look somewhat like this:

../Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c:443:64: warning: passing argument 4 of 'osMessageQueuePut' makes integer from pointer without a cast [-Wint-conversion]

 443 |  (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, NULL);

     |                                                               ^~~~

     |                                                               |

     |                                                               void *

Is it just me who thinks comiler warnings are not to be ignored?

Many Greetings!



> Is it just me who thinks comiler warnings are not to be ignored?

I would agree. Especially with the kind of warning showed (implicit pointer-to-integer).

Since it's ST code, it speaks about quality, extend of testing, and robustness.

Ok for prototypes and hobbyists, but not fit for commercial use.

My company uses to implement a PC-Lint run as second pass for our safety-related projects, that makes such warnings to errors.

Is it ST's code, or is it Amazon's (FreeRTOS) ?

Chief II
osStatus_t osMessageQueuePut(osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout);

If someone passes NULL for a parameter with data type uint32_t, then it says something about that developer. Or to be more precise, it actually says everything...

Ivaylo Ilchev
Associate III

This parameter is ignored, but to be honest, NULL have to be replaced with osPriorityNone.