C / C ++的免费替代品皮棉? [英] C/C++ Free alternative to Lint?

查看:183
本文介绍了C / C ++的免费替代品皮棉?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我感兴趣的是一个免费的工具,可以静态地检查我的C ++ code像皮棉一样。
任何提示?

I'm interested in a free tool that can statically check my C++ code like Lint does. Any hints?

推荐答案

尝试 cppcheck ,在这里找到:的http://cppcheck.sourceforge.net/

Try cppcheck, found here: http://cppcheck.sourceforge.net/

下面是一些可以进行检查采样或者说,我已经使用了:

Here's a sampling of some of the checks it can perform or that I've used it for:


  • 数组索引出界

  • 内存/资源泄漏

  • 新不当/删除

  • 未能把虚析构函数的派生类

  • 不匹配的分配和释放

  • 解除分配一个释放的指针

  • 使用变量,它被释放后/发布

  • 尺寸不匹配

  • 无效基数中调用与strtol strtoul将

  • 重叠数据缓冲区

  • 无符号划分;结果可能是错误的

  • 不寻常的指针运算

  • 返回指向本地数组变量

  • 同样的迭代器被用于两个容器

  • 擦除的危险使用

  • 回送或pushfront后,迭代器可能无效

  • 缓冲区溢出

  • strncat函数的危险使用,可能的缓冲区溢出

  • Array indices out of bounds
  • Memory/resource leaks
  • Improper new/delete
  • Failure to put virtual destructors on derived classes
  • Mismatching allocation and deallocation
  • Deallocating a deallocated pointer
  • Using variable after it is deallocated / released
  • Size mismatches
  • Invalid radix in call to strtol or strtoul
  • Overlapping data buffers
  • Unsigned division; result may be wrong
  • Unusual pointer arithmetic
  • Returning pointer to local array variable
  • Same iterator is used with two containers
  • Dangerous usage of erase
  • After pushback or pushfront, iterator may be invalid
  • Buffer overruns
  • Dangerous usage of strncat, possible buffer overrun

这篇关于C / C ++的免费替代品皮棉?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆