Partager via


C6530

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

warning 6530: unrecognized format string style <name>

Note

This warning occurs only in code that is using a deprecated version of the source-code annotation language (SAL). We recommend that you port your code to use the latest version of SAL. For more information, see Using SAL Annotations to Reduce C/C++ Code Defects.

This warning indicates that the FormatString property is using a value other than scanf or printf. To correct this warning, review your code and use a valid value for the Style property.

Example

The following code generates this warning because of a typo in the Style property:

// C  
#include <CodeAnalysis\SourceAnnotations.h>  
void f([SA_FormatString(Style="printfd")] char *px);   
  
// C++  
#include <CodeAnalysis\SourceAnnotations.h>  
using namespace vc_attributes;  
void f([FormatString(Style="printfd")] char *px);  
  

To correct this warning, use a valid Style as shown in the following code:

// C  
#include <CodeAnalysis\SourceAnnotations.h>  
void f([SA_FormatString(Style="printf")] char *px);   
  
// C++  
#include <CodeAnalysis\SourceAnnotations.h>  
using namespace vc_attributes;  
void f([FormatString(Style="printf")] char *px);