Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
C6509
Collapse the table of content
Expand the table of content

C6509

warning C6509: invalid annotation: 'return' cannot be referenced from a precondition

This warning indicates that the return keyword cannot be used in a precondition. The return keyword is used to terminate the execution of a function and return control to the calling function.

The following code generates this warning because return is used in a precondition:

#include <sal.h>

int f (_In_reads_(return) char *pc)
{
    // code ...
    return 1;
}

To correct this warning, use the following code:

#include <sal.h>

int f (_In_reads_(i) char *pc, int i)
{
    // code ...
    return 1;
}
Show:
© 2015 Microsoft