I have to use some library, and have no power to change it or care about it, EveryTime i compile a HUGE number of warnings popup. Useless things like
: warning C4350: behavior change: 'std::auto_ptr<_Ty>::auto_ptr(std::auto_ptr_ref<_Ty>) throw()' called instead of 'std::auto_ptr<_Ty>::auto_ptr(std::auto_ptr<_Ty> &) throw()'
I want to complete disable Warnings to this specific library. |But still want to have warnings to my own code. Is it possible in Visual Studio 2010 ?
To answer your question about disabling specific warnings in GCC, you can enable specific warnings in GCC with -Wxxxx and disable them with -Wno-xxxx. From the GCC Warning Options: You can request many specific warnings with options beginning -W , for example -Wimplicit to request warnings on implicit declarations.
You can make all warnings being treated as such using -Wno-error. You can make specific warnings being treated as such by using -Wno-error=<warning name> where <warning name> is the name of the warning you don't want treated as an error. If you want to entirely disable all warnings, use -w (not recommended).
If you want to turn it on (or off) in the project setting, you have to go to: Configuration Properties -> C/C++ -> Command Line and then under Additional Options you can enter: /w3#### to set your warning to level 3, and thus enable it; or you can enter /wd#### to disable a warning.
#pragma warning is one option, though it's probably only feasible if you use precompiled headers or have very few source files in your own project.
#pragma warning (push)
#pragma warning (disable : 4350)
#include <third/party/headers/in/question.h>
#pragma warning (pop)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With