This documentation is archived and is not being maintained.

C6523

warning C6523: invalid size specification: parameter <name> not found

This warning indicates that a parameter used to set a property value is not in the function parameter list. You can use annotation properties that accept the name of a parameter as their value, but you must make sure that the parameter exists and is of the correct data type.

Example

The following code generates this warning because parameter count is missing:

// C
#include <CodeAnalysis\SourceAnnotations.h>
void f ([SA_Pre(ElementSize="count", ValidElementsConst=4)] char *pc); 

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
void f ([Pre(ElementSize="count", ValidElementsConst=4)] char *pc); 

To correct this warning, use the following code:

// C
#include <CodeAnalysis\SourceAnnotations.h>
void f ([SA_Pre(ElementSize="count", ValidElementsConst=4)] char *pc, size_t count);
 
// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
void f ([Pre(ElementSize="count", ValidElementsConst=4)] char *pc, size_t count);

See Also

Other Resources

Annotation Properties

Show: