Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PC Lint info 825 suppress无法使用故障诊断注释_C_Pc Lint - Fatal编程技术网

PC Lint info 825 suppress无法使用故障诊断注释

PC Lint info 825 suppress无法使用故障诊断注释,c,pc-lint,C,Pc Lint,我有一个代码,虽然我使用了/*fallthrough*/注释,但我在其中获得了PC Lint info 825。告诉我我的用法是否有错误 示例代码: case 1: case 2: case 3: { statement; } /* fallthrough */ case 4: { statement 1; statement 2; break; } default: break; 这是错误的评论内容。尝试: //lint -fallthrough 有关详细信息,请参阅。解

我有一个代码,虽然我使用了
/*fallthrough*/
注释,但我在其中获得了
PC Lint info 825
。告诉我我的用法是否有错误

示例代码:

case 1:

case 2:

case 3:
{
    statement;
}

/* fallthrough */

case 4:
{
statement 1;
statement 2;
break;
}

default:
break;

这是错误的评论内容。尝试:

//lint -fallthrough

有关详细信息,请参阅。

解决方案:永远不要使用icky fall-through功能,它几乎肯定是错误的解决方案,并且是糟糕程序设计的强烈迹象。如何通过编写正确的代码来抑制上述信息,而不是失败。它是有效的,但正如上面的注释所示,使用它是不好的