Export (0) Print
Expand All

C6516

warning C6516: invalid annotation: no properties specified for <name> attribute

This warning indicates that either no property was specified in the attribute or the property that was specified is invalid; therefore, the attribute cannot be considered complete.

Example

The following code generates this warning because Deref=1 only specifies the level of indirection, but this information alone does not help the analysis tool:

// C
#include <CodeAnalysis\SourceAnnotations.h>
void f([SA_Pre(Deref=1)] char* pc);

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

To correct this warning, another property, such as Access, is required to indicate to the analysis tool what must be enforced on the de-referenced items. The following code corrects this warning:

// C
#include <CodeAnalysis\SourceAnnotations.h>
void f([SA_Pre(Deref=1, Access=SA_Read)] char* pc); 

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

Community Additions

ADD
Show:
© 2014 Microsoft