Partager via


C6501

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 C6501: annotation conflict: <name> property conflicts with previously specified property

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.

Example

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[] );  

See Also

ValidElementsConst
ValidBytesConst