Friday, December 11, 2009

Warning suppression

Maybe you are leveraging an older library (in compiler terms) that is using deprecated APIs and is causing warnings and the warnings suggest suppression using _CRT_SERCURE_NO_WARNINGS and instructs you to see online for info...

Well if you want to use this simply go into the vcproj C/C++ settings Pre-processor and add _CRT_SECRE_NO_WARNINGS to the list. Caveat, this is a broad stroke and should only be used if that code is segregated in its own vcproj and will not be actively developed. Code under active development should just adapt to remove the warnings.

Warning by warning suppression:
directly in the code it is possible to suppress individual or blocks of warnings like this,
#pragma warning (disable: )
code generating the warning
#pragma warning (default: )
the "warning#" would be the same number in both statements.
There is more than one way to do this, but that exploration is left as an exercise to the reader...

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.