STMicroelectronics / STM32CubeWB

Full Firmware Package for the STM32WB series: HAL+LL drivers, CMSIS, BSP, MW, plus a set of Projects (examples and demos) running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits).
https://www.st.com/en/embedded-software/stm32cubewb.html
Other
227 stars 138 forks source link

Potential variable name clash with C macros #56

Closed 42Bastian closed 1 year ago

42Bastian commented 2 years ago

Version: v1.13.3 File: ./Drivers/STM32WBxx_HAL_Driver/Inc/stm32wbxx_hal_pwr_ex.h

void              HAL_PWREx_HoldCore(uint32_t CPU);
void              HAL_PWREx_ReleaseCore(uint32_t CPU);

Usage of all upper-case for a variable name (may) clash with with macro definitions (which in many style guides shall use all upper-case).

ALABSTM commented 1 year ago

Hi @42Bastian,

Thank you for this report. In the prototypes you mentioned, CPU is rather the argument's name of the function, not a variable. Besides, I can understand from your comment that this actually caused no issue, simply a "potential" risk, which I believe is not one.

Please allow me to close this issue. Thank you for your comprehension and thank you again for this report.

With regards,

42Bastian commented 1 year ago

It actually is a problem and should be refactored to not use all upper-case letters.

Just the other day a customer got weird compiler errors until we found out that the macro CPU used in our files clashes with the word CPU used in the parameter list.

No matter if "variable" or "parameter" (a parameter is as well a variable in the function body).