-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Build error: keyword is hidden by macro definition! #1985
Comments
There are more Warnings with Clang 9.0.0 [58/85] Building CXX object test/CMakeFiles/test-noexcept.dir/src/unit-noexcept.o
/Users/clausklein/Workspace/cpp/json/test/src/unit-noexcept.cpp:45:6: warning: function 'to_json' is not needed and will not be emitted [-Wunneeded-internal-declaration]
void to_json(json&, pod) noexcept;
^
/Users/clausklein/Workspace/cpp/json/test/src/unit-noexcept.cpp:46:6: warning: function 'to_json' is not needed and will not be emitted [-Wunneeded-internal-declaration]
void to_json(json&, pod_bis);
^
/Users/clausklein/Workspace/cpp/json/test/src/unit-noexcept.cpp:47:6: warning: function 'from_json' is not needed and will not be emitted [-Wunneeded-internal-declaration]
void from_json(const json&, pod) noexcept;
^
/Users/clausklein/Workspace/cpp/json/test/src/unit-noexcept.cpp:48:6: warning: function 'from_json' is not needed and will not be emitted [-Wunneeded-internal-declaration]
void from_json(const json&, pod_bis);
^
4 warnings generated. |
The bad code style is not in productive code, but in the test suite, which needs access to private members to achieve 100% code coverage. I would be happy to use a different approach (without refactoring the library). The Any suggestions? |
If all you are doing it being a consumer of the library and not a developer of it you an allway disable the build of the with this cmake flag That should get rid of most of those warnings |
May be this a solution?
http://bloglitb.blogspot.com/2010/07/access-to-private-members-thats-easy.html
and see too
Uses and Abuses of Access Rights #4
http://www.gotw.ca/gotw/076.htm
… Am 14.03.2020 um 10:49 schrieb Niels Lohmann ***@***.***>:
The bad code style is not in productive code, but in the test suite, which needs access to private members to achieve 100% code coverage. I would be happy to use a different approach (without refactoring the library).
The -Wunneeded-internal-declaration warnings could be resolved by removing the declaration, but then GCC will warn about missing declarations. I am not sure what do do about that.
Any suggestions?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#1985 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAN7QWS6BBJ6FLUB5SJBJMDRHNHMNANCNFSM4LHGV5NA>.
|
Hm. I read about this once, but never followed up. Interesting! I'll see if I can make this work. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I am not sure whether it is worth investing time to get rid of warnings in the test suite. PRs welcome, though. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This is BAD code style:
The text was updated successfully, but these errors were encountered: