STMicroelectronics / stm32h5xx_hal_driver

Provides the STM32Cube MCU Component "hal_driver" of the STM32H5 series.
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

Missing pre-processor directive "defined" cause warning. #3

Open 42Bastian opened 7 months ago

42Bastian commented 7 months ago

Commit: b21b55fe8b05245d06c559a09a77edf5a0679a74 File: stm32h5xx_hal_def.h Line: 178

https://github.com/STMicroelectronics/stm32h5xx_hal_driver/blob/b21b55fe8b05245d06c559a09a77edf5a0679a74/Inc/stm32h5xx_hal_def.h#L178

=>

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

42Bastian commented 7 months ago

Also here https://github.com/STMicroelectronics/stm32h5xx_hal_driver/blob/b21b55fe8b05245d06c559a09a77edf5a0679a74/Inc/stm32h5xx_hal_def.h#L211

TOUNSTM commented 7 months ago

Hello @42Bastian,

Thank you for your contribution. Could you please confirm if the issue occurs solely when the -Wundef flag is activated?

With regards,

42Bastian commented 7 months ago

Only with -Wall (whicht includes -Wundef). But I'd say, -Wall should be standard when compiling. ;-)

The construct ((__ARMCC_VERSION && (...)) makes no sense as undefined macros are replaced by 0. So the first part of the term is fully handled by the second.

TOUNSTM commented 7 months ago

See also https://github.com/STMicroelectronics/STM32CubeU5/issues/16

TOUNSTM commented 4 months ago

ST Internal Reference: 181063

ra1nb0w commented 3 months ago

obviously, same issue for STM32CubeH5