Linux 上的 PVS Studio - 命令行返回代码



Windows命令行的官方文档非常清楚 - 返回代码是一个位掩码,每个位都意味着一些东西,特别是代码"256"表示"在源代码中发现了一些问题"。

对于 Linux 命令行操作,我可以得到这条帮助消息,pvs-studio-analyzer --help

pvs-studio-analyzer state codes that form a bit mask exit code are:
0 - Analysis was successfully completed, no issues
were found in the source code;
1 - Preprocessing failed on some file(s);
2 - Indicates that analyzer license will expire in
less than a month;
3 - Analysis was interrupted;
4 - Error (crash) during analysis of some source file(s);
5 - Indicates that analyzer license has expired;
6 - License expiration warning suppression flag was used
with non-expiring license;

首先,这些代码不能形成有效的位掩码,它们不是2的幂!
其次,没有特定的返回代码,这意味着"在源代码中发现了一些问题",我对此特别感兴趣 - 所以没有明显的方法来检查是否发现了任何问题(并以某种方式做出反应(。

第三,我在官方文档中找不到有关 Linux 上的返回代码的任何信息。

所以,我的问题是 - 这条帮助消息是否正确?如果是,我如何检查是否发现了任何问题?

Linux 和 macOS 的pvs-studio-analyzer实用程序实际上不会返回位掩码。我们修复了描述。

要检测报告中存在警告的情况,请使用plog-converter实用程序:

plog-converter ... --indicate-warnings ...

-w, --指示警告。设置此选项以在筛选分析日志后检测分析器警告的预感,方法是设置 转换器退出代码为"2"。

最新更新