-
Notifications
You must be signed in to change notification settings - Fork 318
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
Eliminate variable shadowing in local.c #611
Comments
msporcich
pushed a commit
to msporcich/libiio
that referenced
this issue
Oct 20, 2020
Forked with a proposed resolution. I'm interested in getting any comments and then signoff so that I may issue a pull request. Thanks. |
the change looks reasonable to me thanks |
msporcich
pushed a commit
to msporcich/libiio
that referenced
this issue
Oct 20, 2020
Resolves build problems when compiling with -Werror=shadow. Signed-off-by: Marc Sporcich <[email protected]>
commodo
pushed a commit
that referenced
this issue
Oct 21, 2020
Resolves build problems when compiling with -Werror=shadow. Signed-off-by: Marc Sporcich <[email protected]>
Only question is should we add Nominally it's |
rgetz
added a commit
that referenced
this issue
Nov 10, 2020
Warn whenever a local variable or type declaration shadows another variable, parameter, or type. This will make sure (hopefully) that #611 don't come back. tested with: - cmake 3.13.4 & gcc 8.3.0 (debian) - cmake 3.13.4 & gcc 8.3.0 (Raspbian) - cmake 2.8.12.2 & gcc 4.8.2 (Zynq) Signed-off-by: Robin Getz <[email protected]>
closing this. |
dNechita
pushed a commit
that referenced
this issue
Nov 11, 2020
Warn whenever a local variable or type declaration shadows another variable, parameter, or type. This will make sure (hopefully) that #611 don't come back. tested with: - cmake 3.13.4 & gcc 8.3.0 (debian) - cmake 3.13.4 & gcc 8.3.0 (Raspbian) - cmake 2.8.12.2 & gcc 4.8.2 (Zynq) Signed-off-by: Robin Getz <[email protected]>
mhennerich
pushed a commit
that referenced
this issue
Mar 30, 2021
Warn whenever a local variable or type declaration shadows another variable, parameter, or type. This will make sure (hopefully) that #611 don't come back. tested with: - cmake 3.13.4 & gcc 8.3.0 (debian) - cmake 3.13.4 & gcc 8.3.0 (Raspbian) - cmake 2.8.12.2 & gcc 4.8.2 (Zynq) Signed-off-by: Robin Getz <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In local.c, there are two instances of variable shadowing which cause the build to fail when compiling with flag
-Werror=shadow
In local_close()
error: declaration of ‘i’ shadows a previous local [-Werror=shadow]
In get_short_attr_name()
error: declaration of ‘len’ shadows a previous local [-Werror=shadow]
The text was updated successfully, but these errors were encountered: