我有一个带有 ANSI C 代码的 Visual Studio Windows 控制台应用程序。主函数定义类似于:
int main(void)
{
// do stuff
return 0;
}
但是,PC-Lint 报告int类型的以下消息
注 970:在 typedef [MISRA 2012 Directive 4.6,咨询] 之外使用修饰符或类型 <strong>int</strong>
我需要为 main 函数和 Note 970 保留 int 类型。因此,我只想为 main 函数定义禁止 Note 970。我不想在源代码上加上 //lint !e970。
我想知道是否可以仅在使用 PC-Lint 选项定义主函数时禁止显示此消息。