STM32Cube MCU Full Package for the STM32F4 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
897
stars
424
forks
source link
Warning in sd_diskio.c - osMessageQueuePut integer from pointer without a cast #145
Describe the bug
A clean compilation on a freshly generated code has two identical warnings:
passing argument 3 of 'osMessageQueuePut' makes integer from pointer without a cast [-Wint-conversion]
(on file sd_diskio.c, lines 644 and 663).
In both cases the offending line is osMessageQueuePut(SDQueueID, (const void *)&msg, NULL, 0);, while the prototype of the function is osStatus_t osMessageQueuePut (osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout), so parameter 3 is implicitly converted from a pointer (NULL) to a uint8_t.
How To Reproduce
Setup a project on any (I think) STM32F4
Activate FATFS and FREERTOS (CMSIS_V2)
Generate the code
Build the code
Additional context
Instead of using NULL use the appropriate priority (osPriorityNone, defined in cmsis_os2.h, as suggested in this post)
Describe the set-up
Describe the bug A clean compilation on a freshly generated code has two identical warnings:
(on file sd_diskio.c, lines 644 and 663).
In both cases the offending line is
osMessageQueuePut(SDQueueID, (const void *)&msg, NULL, 0);
, while the prototype of the function isosStatus_t osMessageQueuePut (osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout)
, so parameter 3 is implicitly converted from a pointer (NULL
) to auint8_t
.How To Reproduce
Additional context Instead of using
NULL
use the appropriate priority (osPriorityNone
, defined incmsis_os2.h
, as suggested in this post)