#pragma warning suppress #9396
Replies: 2 comments 1 reply
-
While I would too like something like this, "suppress" is a bad word. Because now you have two words that are practically synonyms ("disable" and "suppress") that mean different things. I really like how ReSharper/Rider do |
Beta Was this translation helpful? Give feedback.
0 replies
-
Duplicate of #1070 The definition of "line" is very unclear. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Proposed Feature
Add
#pragma warning suppress warning-list
to disable the listed warning(s) on the next line, then restore them.Background and Motivation
Suppressing warnings in C# is needlessly noisy with 2 lines required for the (most commonly) one line that needs it.
MSVC provides a neat solution to temporarily suppress warnings:
#pragma warning(suppress:warning-number-list)
Documentation: https://learn.microsoft.com/en-us/cpp/preprocessor/warning
Beta Was this translation helpful? Give feedback.
All reactions