Using "#pragma warning (default: ...)" resets the warning in question to its default settings, which may not be what the compiler was initially invoked with. Typically, this usage is seen after a warning is turned off, in preparation for code that is known to cause warnings. Instead, the warning's current state should be saved, and then restored after the code in question.


== Noncompliant Code Example

----
#pragma warning (disable: TheWarning)
#include problem_code.h
#pragma warning (default: TheWarning)
----


== Compliant Solution

----
#pragma warning (push)
#include problem_code.h
#pragma warning (pop)
----


== See

* https://wiki.sei.cmu.edu/confluence/x/6NUxBQ[CERT, MSC00-C.] - Compile cleanly at high warning levels

