5 ms·
Didn't see any mention of any static analysis tools for C++. Any HN recommendations?
by dclusin 7y ago
Didn't see any mention of any static analysis tools for C++. Any HN recommendations?
- tcoff91 7y agoCoverity is used at my company and seems to work reasonably well.
- linuxlizard 7y agoI hear about PVS-Studio often.
- account42 7y agoI only hear about PVS-Studio from their adticles that they agressively post to programming-related communities.
- jcelerier 7y ago- https://clang.llvm.org/extra/clang-tidy/ https://clang.llvm.org/extra/clang-tidy/ - cppcheck is sometimes updated also - clazy : https://github.com/KDE/clazy https://github.com/KDE/clazy
- Fronzie 7y agoNote that https://clang-analyzer.llvm.org/scan-build.html https://clang-analyzer.llvm.org/scan-build.html is another llvm-based static analyzer. It does a more deep analysis into the control flow, whereas clang-tidy does (mostly?) comparatively simpler checks on the AST.
- pnako 7y agoYou can actually run the static analysis checks from clang-tidy.
- Thieum22 7y agodirect link to cppcheck releases: https://github.com/danmar/cppcheck/releases https://github.com/danmar/cppcheck/releases
- The_rationalist 7y agohttps://github.com/facebook/infer https://github.com/facebook/infer Seems cool.
- imagiko 7y agoI'm interested in this too! I've been looking for one that can be used with arm-gcc for cross compiling on embedded platforms. What do people use in such situations?
- account42 7y agoClang has support for cross-compiling [1] without needing separate builds for each target so you should be able to use clang-analyzer and clang-tidy whit the right -target flag for your ARM platform. https://clang.llvm.org/docs/CrossCompilation.html https://clang.llvm.org/docs/CrossCompilation.html Besides that, most bugs found by static analysis are platform independent so you should be able to use any static analyzer you get your hands on as long as your code is cross-platform.
- imagiko 7y agoOh cool, thanks!
- pjmlp 7y agoI use what Visual C++ offers, which is already quite nice. Plus VC++ debug builds do bounds checking, even for [].
- wallstprog 7y agoI wrote a few posts on this topic that may be helpful: http://btorpey.github.io/blog/categories/static-analysis/ http://btorpey.github.io/blog/categories/static-analysis/