Proposal: Add pragma directive to temporarily promote specific compiler/analyzer warnings to errors #8036
Unanswered
sindrijo
asked this question in
Language Ideas
Replies: 1 comment 2 replies
-
Duplicate of #3986. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In some contexts it would be useful to be able to force a compiler warning to be an error with a pragma directive. As far as I am aware it's currently only possible to do this by editing the
.editorconfig
file:However that might not always be desirable, so it would be useful to be able to selectively upgrade a warning to an error temporarily with a pragma directive.
Example: Unity-3d packages are usually distributed as source code. In this example a package defines an enum type which must be equivalent to another enum type in one of it's dependencies exactly. If the dependency is updated to a version which adds a new entry to the other enum type it should result in a compilation error in this package.
NB this feature already exists in CPP: https://learn.microsoft.com/en-us/cpp/preprocessor/warning?view=msvc-170
Beta Was this translation helpful? Give feedback.
All reactions