Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

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

Community Additions

ADD
Show:
© 2015 Microsoft