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