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

Declaration shadowing warnings from clang #764

Closed
asmaloney opened this issue Oct 6, 2019 · 2 comments
Closed

Declaration shadowing warnings from clang #764

asmaloney opened this issue Oct 6, 2019 · 2 comments

Comments

@asmaloney
Copy link
Contributor

With the latest Apple clang version 11.0.0 (clang-1100.0.33.8), I'm getting three warnings about shadowed variables:

In file included from 3rdParty/include/yaml-cpp/yaml.h:12:
3rdParty/include/yaml-cpp/emitterstyle.h:12:25: warning: declaration shadows a variable in namespace 'YAML' [-Wshadow]
  enum value { Default, Block, Flow };
                        ^
3rdParty/include/yaml-cpp/emittermanip.h:52:3: note: previous declaration is here
  Block,
  ^
In file included from 3rdParty/include/yaml-cpp/yaml.h:12:
3rdParty/include/yaml-cpp/emitterstyle.h:12:32: warning: declaration shadows a variable in namespace 'YAML' [-Wshadow]
  enum value { Default, Block, Flow };
                               ^
3rdParty/include/yaml-cpp/emittermanip.h:51:3: note: previous declaration is here
  Flow,
  ^
In file included from 3rdParty/include/yaml-cpp/yaml.h:16:
In file included from 3rdParty/include/yaml-cpp/node/node.h:18:
3rdParty/include/yaml-cpp/node/type.h:12:27: warning: declaration shadows a variable in namespace 'YAML' [-Wshadow]
  enum value { Undefined, Null, Scalar, Sequence, Map };
                          ^
3rdParty/include/yaml-cpp/null.h:23:27: note: previous declaration is here
extern YAML_CPP_API _Null Null;
                          ^
3 warnings generated.
@jbeder
Copy link
Owner

jbeder commented Oct 13, 2019

I'm not super concerned about that kind of shadowing. In any case, it's part of the public API and I don't think I want to change it for the sake of avoiding a shadowing problem that's unlikely to arise. Thanks for the report, though!

@jbeder jbeder closed this as completed Oct 13, 2019
jbeder pushed a commit that referenced this issue Sep 20, 2022
Minimize warnings when not the top-level project

Should fix #970 and #764 when trying to add yaml-cpp to other project
davemccann pushed a commit to davemccann/yaml-cpp that referenced this issue Jul 30, 2023
Minimize warnings when not the top-level project

Should fix jbeder#970 and jbeder#764 when trying to add yaml-cpp to other project
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

3 participants