警告 C6509:无效的批注: 不能从前置条件引用“return”
此警告意味着 return 关键字不能在前置条件。return 关键字用于终止函数的执行和控件返回到调用函数。
示例
因为 return 在前置条件,下面的代码生成此警告:
#include <sal.h>
int f (_In_reads_(return) char *pc)
{
// code ...
return 1;
}
若要更正此警告,请使用下面的代码:
#include <sal.h>
int f (_In_reads_(i) char *pc, int i)
{
// code ...
return 1;
}