pvs-studio - 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”,设置此选项以在过滤分析日志后检测分析器警告的存在。
推荐阅读
- javascript - Reactjs 从日历中异步加载事件 - Google Calendar API
- c# - 如何以最易读的方式使用 LanguageExt 在 C# 中构建嵌套的 HashMap?
- azure - 通过逻辑应用执行时如何从 Runbook 获取参数
- powershell - Export-Csv 创建一个空文件
- ansible - 如何安装 Ansible 塔?
- reactjs - react-js中的状态如何变回原来的值
- bash - 从命令行参数将带空格的字符串分配给变量
- ubuntu - 如何将保护文件复制到 ubuntu 上的另一个目录(在终端中)
- java - org.apache.hadoop.security.AccessControlException:客户端无法通过以下方式进行身份验证:[TOKEN,KERBEROS] 问题
- vb.net - 使用 CType 转换没有时间组件的日期会产生不一致的结果