Udostępnij za pośrednictwem


C6514

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 C6514: invalid annotation: value of the <name> property exceeds the size of the array

This warning indicates that a property value exceeds the size of the array specified in the parameter being annotated. This warning occurs when the value specified for the annotation property is greater than the actual length of the array being passed.

Example

The following code generates this warning because the size of the array is 6 whereas the ValidElementsConst property value is 8:

// C  
#include <CodeAnalysis\SourceAnnotations.h>  
void f( [SA_Pre(Deref=1, ValidElementsConst=8)] char(*matrix) [6] );  
  
// C++  
#include <CodeAnalysis\SourceAnnotations.h>  
using namespace vc_attributes;  
void f( [Pre(Deref=1, ValidElementsConst=8)] char(*matrix) [6] );  
  

To correct this warning, make sure the size of specified in ValidElementsConst is less than or equal to the size of the array, as shown in the following sample code:

// C  
#include <CodeAnalysis\SourceAnnotations.h>  
void f( [SA_Pre(Deref=1, ValidElementsConst=6)] char(*matirx) [6] );  
  
// C++  
#include <CodeAnalysis\SourceAnnotations.h>  
using namespace vc_attributes;  
void f( [Pre(Deref=1, ValidElementsConst=6)] char(*matirx) [6] );