Skip to main content
Explorer II
January 16, 2025
Solved

Extra parentheses in HAL_DACEx_ClearConfigAutonomousMode() (in stm32u5xx_hal_dac_ex.c)

  • January 16, 2025
  • 1 reply
  • 559 views

image.png

In HAL_DACEx_ClearConfigAutonomousMode(), a test is surrounded by parentheses that are clearly unnecessary in code generated by STM32CubeMx.
This is not very important... but it generates warnings that I check at each compilation...

    This topic has been closed for replies.
    Best answer by JVERN.18

    Sorry for the scrrenshots, I'll be more careful next time...

    The compiler is LLVM/Clang and the warning is "equality comparison whith extraneous parentheses [-Wparentheses-equality]"

    This is not a very important warning, and I see that GNU does not see a problem... but it would still be bette if the extra parentheses were not there...

    1 reply

    Super User
    January 16, 2025

    Please see the community guidelines for how to properly post source code - not as screenshots:

    How to write your question to maximize your chances to find a solution

    How to insert source code

     


    @JVERN.18 wrote:

     it generates warnings .


    What warnings, exactly?

    And what build tools & version are you using?

    JVERN.18AuthorAnswer
    Explorer II
    January 16, 2025

    Sorry for the scrrenshots, I'll be more careful next time...

    The compiler is LLVM/Clang and the warning is "equality comparison whith extraneous parentheses [-Wparentheses-equality]"

    This is not a very important warning, and I see that GNU does not see a problem... but it would still be bette if the extra parentheses were not there...