次の方法で共有


Style

Style プロパティは、SA_FormatString 属性で使用する書式指定文字列を持つ関数を指定します。 分析中、可変個引数リストに指定された各型が、書式指定文字列中の書式指定子 (%d や %s など) と比較されます。

Style の有効値は printf (printf 関数と wprintf 関数の場合) と scanf (printf 関数と wprintf 関数の場合) です。

Style プロパティは、次の型のパラメーターで使用できます。

  • char*

  • wchar_t*

  • const char*

  • const wchar_t *

使用例

Style プロパティの使用例を次のコードに示します。

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

参照

概念

注釈の概要

その他の技術情報

注釈のプロパティ