Partager via


C6511

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 C6511: invalid annotation: MustCheck property must be Yes or No

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 an invalid value for MustCheck property was specified. The only valid values for this property are: Yes and No.

Example

The following code generates this warning:

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

To correct this warning, a valid value for MustCheck property is used in the following code:

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

See Also

Annotation Properties
C6516