linux下cppcheck用法,Linux命令手册

本文介绍Cppcheck,一款用于C/C++代码的静态分析工具,它专注于查找编译器通常无法检测到的错误类型。文章提供了使用Cppcheck进行递归检查、指定测试项及忽略特定测试的方法,并列举了可用的不同类型的测试。
摘要由CSDN通过智能技术生成

cppcheck

A static analysis tool for C/C++ code.

Instead of syntax errors, it focuses on the types of bugs that compilers normally do not detect.

More information: http://cppcheck.sourceforge.net.

Recursively check the current directory, showing progress on the screen and logging error messages to a file:

cppcheck . 2> cppcheck.log

Recursively check a given directory, and don't print progress messages:

cppcheck --quiet {{path/to/directory}}

Check a given file, specifying which tests to perform (by default only errors are shown):

cppcheck --enable={{error|warning|style|performance|portability|information|all}} {{path/to/file.cpp}}

List available tests:

cppcheck --errorlist

Check a given file, ignoring specific tests:

cppcheck --suppress={{test_id1}} --suppress={{test_id2}} {{path/to/file.cpp}}

Check the current directory, providing paths for include files located outside it (e.g. external libraries):

cppcheck -I {{include/directory_1}} -I {{include/directory_2}} .

Check a Microsoft Visual Studio project (*.vcxproj) or solution (*.sln):

cppcheck --project={{path/to/project.sln}}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值