Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer


The Tainted property specifies whether a value is safe for use by other functions. This property is allowed on Pre and Post attributes and can be applied to any data type.

The Tainted property must be set by using one of the following values:

  • SA_Yes - the value is tainted and cannot be trusted.

  • SA_No - the value is not tainted and can be trusted.

  • SA_Maybe - the value might be tainted and cannot be trusted.

The following code shows how to use the Tainted property:

// C 
#include <CodeAnalysis\SourceAnnotations.h>
void f([SA_Pre(Tainted=SA_Yes)] int c);

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
void f([Pre(Tainted=Yes)] int c);
© 2016 Microsoft