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
Expand Minimize

C6501

warning C6501: annotation conflict: <name> property conflicts with previously specified property

Note 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 the presence of conflicting properties in the annotation. This typically occurs when multiple properties that serve similar purpose are used to annotate a parameter or return value. To correct the warning, you must choose the property that best addresses your need.

The following code generates this warning because both ValidElementsConst and ValidBytesConst provide a mechanism to allow valid data to be read:

// C
#include <CodeAnalysis\SourceAnnotations.h>
void fd([SA_Pre(ValidElementsConst =4, ValidBytesConst =4)] char pch[]);

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
void f( [Pre(ValidElementsConst=4, ValidBytesConst=4 )] char pch[] );

To correct this warning, use the most appropriate property, as shown in the following code:

// C
#include <CodeAnalysis\SourceAnnotations.h>
void f( [SA_Pre(ValidElementsConst=4)] char pch[] );

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
void f( [Pre(ValidElementsConst=4)] char pch[] );
Show:
© 2015 Microsoft