-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: expose and fix variable shadowing warnings #17915
base: master
Are you sure you want to change the base?
Conversation
Start exposing variable-shadowing warnings in all builds. Signed-off-by: Mark Stapp <[email protected]>
Fix various "shadow" warnings in lib. Signed-off-by: Mark Stapp <[email protected]>
Clean up various "shadow" warnings. Signed-off-by: Mark Stapp <[email protected]>
Clean up various "shadow" warnings. Signed-off-by: Mark Stapp <[email protected]>
Clean up various "shadow" warnings.
} | ||
|
||
cpu_records_fini(old); | ||
frr_mutex_lock_autounlock(&masters_mtx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any changes in this chunk? What am I missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, this is one of the patterns that was a little awkward. note that the original had a with_mutex
block, and then an inner with_mutex
block. with_mutex
is a macro, and it uses ... a local variable - so the inner block's variable shadows the outer block's. so the conversion replace the outer block, and that resolves the warning.
Clean up various "shadow" warnings in babeld. Signed-off-by: Mark Stapp <[email protected]>
Clean up various variable-shadow warnings in bfdd. Signed-off-by: Mark Stapp <[email protected]>
Clean up various warnings from -Wshadow in eigrp. Signed-off-by: Mark Stapp <[email protected]>
Clean up various variable-shadow warnings in ldpd. Signed-off-by: Mark Stapp <[email protected]>
Clean up various variable-shadow warnings in mgmtd. Signed-off-by: Mark Stapp <[email protected]>
Add the -Wshadow warning option for builds; this exposes variable-shadowing issues. I've cleaned up several components, but some of the choices might be controversial (or ... awkward, or ... wrong), so I'm opening this as a draft to get some feedback before continuing with more components.