News for hackers. Stuff that matters.
Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by dclusin on Tuesday October 08, 2019 @04:17PM (#21196701)
Didn't see any mention of any static analysis tools for C++. Any HN recommendations?
Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by jcelerier on Tuesday October 08, 2019 @04:26PM (#21196816)
- https://clang.llvm.org/extra/clang-tidy/

- cppcheck is sometimes updated also

- clazy : https://github.com/KDE/clazy

Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by Fronzie on Tuesday October 08, 2019 @04:42PM (#21197002)
Note that 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.

Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by pnako on Tuesday October 08, 2019 @04:59PM (#21197203)
You can actually run the static analysis checks from clang-tidy.
Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by account42 on Wednesday October 09, 2019 @10:20AM (#21203511)
But you won't get the detailed HTML output that tells you why Clang Analyzer things a problem exists.
Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by jcelerier on Tuesday October 08, 2019 @05:36PM (#21197555)
yep, see all the clang-analyzer checks listed here : https://clang.llvm.org/extra/clang-tidy/checks/list.html
Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by Thieum22 on Tuesday October 08, 2019 @10:01PM (#21199279)
direct link to cppcheck releases: https://github.com/danmar/cppcheck/releases
Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by The_rationalist on Tuesday October 08, 2019 @04:50PM (#21197092)
Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by wallstprog on Wednesday October 09, 2019 @11:03AM (#21203896)
I wrote a few posts on this topic that may be helpful: http://btorpey.github.io/blog/categories/static-analysis/
Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by linuxlizard on Tuesday October 08, 2019 @04:22PM (#21196777)
I hear about PVS-Studio often.
Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by account42 on Wednesday October 09, 2019 @10:33AM (#21203635)
I only hear about PVS-Studio from their adticles that they agressively post to programming-related communities.
Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by imagiko on Tuesday October 08, 2019 @08:23PM (#21198716)
I'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?
Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by account42 on Wednesday October 09, 2019 @10:32AM (#21203620)
Clang 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

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.

Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by imagiko on Thursday October 10, 2019 @11:42AM (#21215814)
Oh cool, thanks!
Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by pjmlp on Wednesday October 09, 2019 @01:50AM (#21200416)
I use what Visual C++ offers, which is already quite nice.

Plus VC++ debug builds do bounds checking, even for [].

Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by account42 on Wednesday October 09, 2019 @10:22AM (#21203531)
You can also get run-time checks in libstdc++ and libc++ with -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC and -D_LIBCPP_DEBUG=1.
Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by pjmlp on Wednesday October 09, 2019 @04:51PM (#21207910)
Thanks, I guess I spend too much time on Windows. :)
Re:C++ Ecosystem: Compilers, IDEs, Tools, Testing by tcoff91 on Tuesday October 08, 2019 @04:22PM (#21196771)
Coverity is used at my company and seems to work reasonably well.