Skip to main content
RFlec.1
Associate III
Mar 16, 2021 9:08 AM UTC
Question

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

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

This topic has been closed for replies.

4 replies

Ozone
Principal
Mar 16, 2021 10:07 AM UTC

> 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.

Andrew Neil
Super User
Mar 16, 2021 10:24 AM UTC

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

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Piranha
Principal III
Mar 16, 2021 8:30 PM UTC
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
Oct 19, 2021 12:06 PM UTC

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