C6525
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

C6525

warning C6525: invalid size specification: property value may not be valid

This warning indicates that the property value used to specify the size is not valid. This occurs if the size parameter is annotated using Valid=No.

Example

The following code generates this warning because the ValidElements property uses a size parameter that is marked not valid:

// C
#include <CodeAnalysis\SourceAnnotations.h>
void f([SA_Pre(ValidElements="*count")] char * px, [SA_Pre(Valid=SA_No)]size_t *count); 

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
void f([Pre(ValidElements="*count")] char * px, [Pre(Valid=No)]size_t *count); 

To correct this warning, specify a valid size parameter as shown in the following code:

// C
#include <CodeAnalysis\SourceAnnotations.h>
void f([SA_Pre(ValidElements="*count")] char * px, [SA_Pre(Valid=SA_Yes)]size_t *count); 

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
void f([Pre(ValidElements="*count")] char * px, [Pre(Valid=Yes)]size_t *count); 

See Also

Other Resources

Annotation Properties

Show:
© 2016 Microsoft