Skip to content

Latest commit

 

History

History
52 lines (37 loc) · 1.81 KB

c6500.md

File metadata and controls

52 lines (37 loc) · 1.81 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Warning C6500
Warning C6500
11/04/2016
C6500
INVALID_ATTRIBUTE_PROPERTY
__WARNING_INVALID_ATTRIBUTE_PROPERTY
C6500
bfc61ec1-8ac5-4465-a23c-91418fbc4552

Warning C6500

Invalid annotation: value for 'name' property is invalid

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.

Remarks

This warning indicates that a property value used in the annotation isn't 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.

Code analysis name: INVALID_ATTRIBUTE_PROPERTY

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.