Dela via


C6500

warning C6500: invalid annotation: value for <name> property is invalid

This warning indicates that a property value used in the annotation is not valid. For example, it can occur if an incorrect level of dereference is used in the Deref property, or if you use a constant value that is larger than size_t for properties like ElementSize.

Example

The following code generates this warning because an incorrect level of dereference is used in the Pre condition:

// C
#include <CodeAnalysis\SourceAnnotations.h>
void f( [SA_Pre( Deref=2, Access=SA_Read )] char buffer[] );

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;

void f( [Pre( Deref=2, Access=Read )] char buffer[] );

To correct this warning, specify the correct level of dereference, as shown in the following sample code:

// C
#include <CodeAnalysis\SourceAnnotations.h>
void f( [SA_Pre( Deref=1, Access=SA_Read )] char buffer[] );

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;

void f( [Pre( Deref=1, Access=Read )] char buffer[] );

This warning is generated for both Pre and Post conditions.

See Also

Reference

Deref