Reputation: 1790
The syntax for disabling warnings is as follows:
#pragma warning disable 414, 3021
Or, expressed more generally:
#pragma warning disable [CSV list of numeric codes]
Is there a list of these numeric codes and the description of the warning that they're suppressing? Much to my chagrin, I can't seem to locate it via Google.
Upvotes: 29
Views: 32734
Reputation: 80
NOT All Compiler will show the number!
for example: https://bytes.com/topic/c/answers/503957-function-void
The warning is:
a.c: In function `main': a.c:14: warning: ISO C forbids conversion of object pointer to function pointer type
There are NO warning NUMBERS shown that would allow me to fill in the ‵#param warning disable‵ parameter
So, this list is necessary for other compilers
Upvotes: 0
Reputation: 1677
FYI -
If you're using Visual Studio 2008, you can get the code directly from the Error List by right-clicking the error, and selecting Show Error Help from the context menu. The Help window should pop up, and show you everything you ever wanted to know about the error a la the MSDN website.
Could save you a bit of time.
Upvotes: 3
Reputation: 21575
MSDN has a list of warning codes. Unfortunately, you have to click each link to view what the code actually means.
Upvotes: 42
Reputation: 97848
You shouldn't need a list. The compiler will tell you. If you get a compiler error that says "warning CS0168", then add 168 to the list (or, better yet, fix the code).
Upvotes: 14
Reputation: 36534
Look down the list of C# compiler errors and warnings to find the individual warning numbers.
Upvotes: 7