Skip to content
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

local variable shadows parameter warning #676

Closed
nickhuang99 opened this issue May 12, 2021 · 3 comments
Closed

local variable shadows parameter warning #676

nickhuang99 opened this issue May 12, 2021 · 3 comments

Comments

@nickhuang99
Copy link

This local variable shadows function parameter >ch_<

CharT ch_ = static_cast (start_);

It is a trivial issue, but it is nice that somebody can rename this local variable.

@Kojoley
Copy link
Collaborator

Kojoley commented May 12, 2021

Which compiler and warning flag? Spirit is not clear for -Wshadow.

I will check what I can do about it, however the last time I tried there were hard to fix local shadowing in macros and namespace global shadowing that requires an API breaking to fix.

@nickhuang99
Copy link
Author

hi,

First of all, thanks for your prompt response and I really appreciate your wonderful work to boost library which I sincerely hope to do a little bit of my part.

Compiler: gcc-10.2.0
warning flag: -Wshadow-compatible-local
boost: I tried 1.72 and see the latest one is the same as 1.72 on this particular issue.
example code: word_count_functor.cpp

I use the example code "word_count_functor.cpp" for testing (https://www.boost.org/doc/libs/1_72_0/libs/spirit/example/lex/word_count_functor.cpp)

Thank you again,

@nickhuang99
Copy link
Author

BTW, just FYI, I am using this simple script to build/install my gcc-10.2.0 and hope it may save you some time if you haven't installed gcc-10.2 yet in your system.

https://github.com/nickhuang99/gcc-building/blob/4628d92f4c9c2c751701912f34308b82c27c51c2/build_gcc.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants