次の方法で共有


C6530

警告 6530: 認識されない書式文字列のスタイル <名前> です。

この警告は、FormatString プロパティで scanf または printf 以外の値が使用されていることを示します。 この警告を修正するには、コードを確認し、Style プロパティで有効な値を使用します。

使用例

次に示すコードでは、Style プロパティに入力ミスがあるため、この警告が生成されます。

// 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); 

この警告を解決するには、次のコードに示すように Style に有効な値を入力します。

// 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);