Style
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

Style

The Style property specifies a function that has a format string to be used with the SA_FormatString attribute. During analysis, the types of the variable argument list are compared to the format specifiers, for example, %d and %s, in the format string.

The following code shows how to use the Style property:

// C
#include <CodeAnalysis\SourceAnnotations.h>
void f( [SA_FormatString(Style="printf")] char *px, ...); 
 -or-
void f( [SA_FormatString(Style="scanf")] char *px, ...); 

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
void f( [FormatString(Style="printf")] char *px, ...); 
 -or-
void f( [FormatString(Style="scanf")] char *px, ...); 
Show:
© 2016 Microsoft