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

ignore rule-sets warning #3081

Closed
wants to merge 1 commit into from
Closed

ignore rule-sets warning #3081

wants to merge 1 commit into from

Conversation

steve02081504
Copy link

I clone the STL git repository locally and add it to my header path, but since I often have all the c++ rulesets open, the STL library headers become a big num of warnings in my project (providing 1000+ warnings) and I don't know how to ignore it.
This PR fixes that problem

@steve02081504 steve02081504 requested a review from a team as a code owner September 7, 2022 03:51
@frederick-vs-ja
Copy link
Contributor

This PR intends to suppress 40 kinds of warnings. However, none of the related problematic cases is described in the PR at this moment.

Are these warnings triggered within MSVC STL's headers? Have you tried to suppress them before including STL's headers and then unsuppress them after including?

@steve02081504
Copy link
Author

steve02081504 commented Sep 7, 2022

This PR intends to suppress 40 kinds of warnings. However, none of the related problematic cases is described in the PR at this moment.
Are these warnings triggered within MSVC STL's headers? Have you tried to suppress them before including STL's headers and then unsuppress them after including?

These warnings came after I directly included STL\stl\inc as one of the include directories, STL headers from MSVC's install had no such problems
I do this because I want to always experience the latest STL files, but don't want to be overloaded with warnings that are not relevant to me
As for suppressing warnings before include and restoring them afterwards, that's a possible solution, but I feel it's a lot of hassle, especially when I rely on the STL for a lot of my own stuff and there's so much to change

@fsb4000
Copy link
Contributor

fsb4000 commented Sep 7, 2022

Tests fail because #2908 , it is not related to your PR.

@steve02081504
Copy link
Author

If anyone needs it, here are the details of stl's warning content
Sorry but it's in Chinese
build.log

@StephanTLavavej
Copy link
Member

Thanks for looking into this! We talked about this at the weekly maintainer meeting - these warnings do appear to be largely spurious for the STL (for various reasons - e.g. we can't use the GSL because the GSL depends on us! 😹). However, we would want to individually verify that each of these warnings is definitely spurious before silencing them for the STL forever, and 40 warnings is a lot to look into.

We're going to close this PR without merging it, because we've already implemented a solution for projects like yours that are experiencing warnings in STL code. If you define _STL_EXTRA_DISABLED_WARNINGS project-wide to be a space-separated list of warning numbers, our machinery will add that to the list of warnings we always suppress. You can see the machinery here, right next to where your edits were:

STL/stl/inc/yvals_core.h

Lines 667 to 669 in f9697fc

#ifndef _STL_EXTRA_DISABLED_WARNINGS
#define _STL_EXTRA_DISABLED_WARNINGS
#endif // _STL_EXTRA_DISABLED_WARNINGS

STL/stl/inc/yvals_core.h

Lines 697 to 708 in f9697fc

#ifndef _STL_DISABLED_WARNINGS
// clang-format off
#define _STL_DISABLED_WARNINGS \
4180 4412 4455 4494 4514 4574 4582 4583 4587 4588 \
4619 4623 4625 4626 4643 4648 4702 4793 4820 4988 \
5026 5027 5045 6294 \
_STL_DISABLED_WARNING_C4577 \
_STL_DISABLED_WARNING_C4984 \
_STL_DISABLED_WARNING_C5053 \
_STL_EXTRA_DISABLED_WARNINGS
// clang-format on
#endif // _STL_DISABLED_WARNINGS

Hope this helps!

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

Successfully merging this pull request may close these issues.

4 participants