C6511
更新:2007 年 11 月
警告 C6511:无效的批注: MustCheck 属性必须为 Yes 或 No
此警告意味着为 MustCheck 属性指定的值无效。此属性的唯一有效值为 Yes 和 No。
示例
下面的代码生成此警告:
// C
#include <CodeAnalysis\SourceAnnotations.h>
[returnvalue:SA_Post(MustCheck=SA_Maybe)] int f();
// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
[returnvalue:Post(MustCheck=Maybe)] int f();
若要更正此警告,必须对 MustCheck 属性使用有效值,如下面的代码所示:
// C
#include <CodeAnalysis\SourceAnnotations.h>
[returnvalue:SA_Post(MustCheck=SA_Yes)] int f();
// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
[returnvalue:Post(MustCheck=Yes)] int f();