cancel
Showing results for 
Search instead for 
Did you mean: 

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

RFlec.1
Associate II

Hello!

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!

Remo

4 REPLIES 4
Ozone
Lead

> 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) ?

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

https://www.keil.com/pack/doc/CMSIS/RTOS2/html/group__CMSIS__RTOS__Message.html#gaa515fc8b956f721a8f72b2c505813bfc

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.