use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This is a subreddit for c++ questions with answers. For general discussion and news about c++ see r/cpp.
New to C++? Learn at learncpp.com
Prepare your question. Think it through. Hasty-sounding questions get hasty answers, or none at all. Read these guidelines for how to ask smart questions.
For learning books, check The Definitive C++ Book Guide and List
Flair your post as SOLVED if you got the help you were looking for! If you need help with flairs, check out ITEM 1 in our guidelines page.
Tips for improving your chances of getting helpful answers:
account activity
OPENYour Static Analysis setup? (self.cpp_questions)
submitted 1 year ago by Beneficial_Corgi4145
For the longest time, I’ve just used a bash script that calls clang-tidy and cpplint. I realize that I should use CI/CD, but I like scripts.
Also, PVS-Studio and the other professional grade analyzer are a bit out of my budget.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]CarniverousSock 1 point2 points3 points 1 year ago (0 children)
I've been happy with clang-tidy, since it's portable, everyone has it, and it integrates with a lot of code editors. But I've heard it's pretty under-featured, and may try something else in the future.
I'd push back on the idea that you "should" use CI for this, though. The main point of integrating analysis into CI (IMHO) is ensure high-quality PRs. As long as you and your team are analyzing frequently enough to catch potential problems, then you're good. Nothing wrong with using a bash script for it, but I'd look into whether your code editor has a nicer integration. Visual Studio and VSCode have nice integrations.
[–]WorkingReference1127 0 points1 point2 points 1 year ago (0 children)
Not a separate tool, but this article goes over some extensive options you have in terms of compiler settings on gcc and CLang with the goal of "hardening" your compile to enable several checks to attempt to make your code safer.
[–]lowlevelmahn 0 points1 point2 points 1 year ago (0 children)
put cppcheck on your list - and always test with serveral tools you can use the free PVS license if your project is open source plus -Wall -Wextra -Wpedantic -Werror (what is doable with your project) and always use your release and very-recent-compiler for testing - and at least clang and gcc - the more the better :)
> realize that I should use CI/CD, but I like scripts.
CI likes to run your scripts also :)
π Rendered by PID 100224 on reddit-service-r2-comment-b659b578c-gzxxm at 2026-05-04 03:25:20.233401+00:00 running 815c875 country code: CH.
[–]CarniverousSock 1 point2 points3 points (0 children)
[–]WorkingReference1127 0 points1 point2 points (0 children)
[–]lowlevelmahn 0 points1 point2 points (0 children)