Skip to content

Conversation

@marshfolx
Copy link
Contributor

@marshfolx marshfolx commented Dec 16, 2025

I think -Wshadow is a good feature to avoid silly mistakes, like:

void f() {
    bool flag = false;
    // some code
    if(condition) {
        bool flag = true;
    }
    // some more code
    if(flag) {
        // want to do something, but flag is never true
    }
}

I have wasted some time on my silliness recently. So I think it's good to have this warning turned on, and when I do it, SPI and EEPROM libraries make the compiler complain.

This PR just renames those parametes, nearly no cost.

@fpistm fpistm self-requested a review December 16, 2025 07:44
marshfolx and others added 3 commits December 16, 2025 08:56
Signed-off-by: marshfolx <marshfolx@outlook.com>
Signed-off-by: marshfolx <marshfolx@outlook.com>
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @marshfolx
and thanks for pointing an fixing this.
I've added an other fix see on STM32U3 series.

@github-project-automation github-project-automation bot moved this from In progress to Reviewer approved in STM32 core based on ST HAL Dec 16, 2025
@fpistm fpistm merged commit abc65f5 into stm32duino:main Dec 16, 2025
24 checks passed
@github-project-automation github-project-automation bot moved this from Reviewer approved to Done in STM32 core based on ST HAL Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix 🩹 Bug fix

Projects

Development

Successfully merging this pull request may close these issues.

2 participants