Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to suppress all warnings from non-solution files in VisualStudio

I wonder, whether it is possible to suppress warnings coming from included library files, while showing all solution-file warnings in Visual Studio? I have a solution that uses stingray library. When I build the solution I keep getting numerous warnings from stingray files, so I am loosing warnings from my files (that are actually in solution and that I own and edit). For me there is no value in included warnings, since I cannot edit those files, but I do need to see all my warnings.

Is there any way I could do it?

Added after first answer: Sorry for being not clear - I am not building third party library - I am linking the libraries they provided, but I am including their headers in my own - as a results I have numerous warnings in "file included from..." - is there any way to sort that out?

-- Thanks in advance

like image 922
Serge Avatar asked Jun 14 '11 20:06

Serge


1 Answers

#pragma warning(push ,3)

# include third-party h-files

#pragma warning(pop)

Another way:

#pragma warning(disable: 4507 4510)

# include third-party h-files

#pragma warning(default: 4507 4510)
like image 122
Alex F Avatar answered Sep 26 '22 19:09

Alex F