In my Visual C++ code I want to have /WX
- "treat warnings as errors". This makes me deal with each warning, including C4996 - "X was declared deprecated" which I don't want to address - I don't want to change code at the moment and I don't want to disable C4996 so that it remains in the output. So ideally I'd like to have something like:
#pragma warning( ExcludeFromWX:4996)
so that all warnings except this one are treated as errors when /WX
is used and this warning is just displayed and compilation continues.
Is it possible to get such behavior?
You might be able to reset the specified warning by using following pragma. I did not test it though and you did not mention trying this:
UPDATE Changing the warning level should succeed
#pragma warning( 4 : 4996 )
This does not work:
#pragma warning( default : 4996 )
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