Skip to main content
Associate
May 8, 2026
Question

Warning from preprocessor defines checks in STM32Cube FW_U3 V1.3.0

  • May 8, 2026
  • 1 reply
  • 95 views

If the user uses "-Wundef" the header "stm32u3xx_hal_def.h" creates a lot of warnings due to a missing check if a preprocessor macro is defined before evaluating it.

The warning gets emmited by the following #ifs used in STM32Cube FW_U3 V1.3.0 inside "stm32u3xx_hal_def.h":

#if defined ( __CC_ARM ) || ((__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) || defined ( __GNUC__ )

e.g. in line 142

This is how it was correctly checked in e.g. the STM32Cube FW_G0 V1.6.3 in the hal def header for the stm32g0 hal:

#if defined ( __CC_ARM ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))

 

Best Regards

1 reply

Technical Moderator
May 8, 2026

Hello @CecilW 

Thank you for bringing this issue to our attention.

I reported this internally.

Internal ticket number: CDM0062496 (This is an internal tracking number and is not accessible or usable by customers).

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om