STMicroelectronics / STM32CubeF4

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

Closed fra87 closed 1 year ago

fra87 commented 2 years ago

Describe the set-up

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

  1. Setup a project on any (I think) STM32F4
  2. Activate FATFS and FREERTOS (CMSIS_V2)
  3. Generate the code
  4. Build the code

Additional context Instead of using NULL use the appropriate priority (osPriorityNone, defined in cmsis_os2.h, as suggested in this post)

HBOSTM commented 2 years ago

ST Internal Reference: 138617