Aussie AI

Static Analysis Tools (Linters)

  • Book Excerpt from "Generative AI in C++"
  • by David Spuler, Ph.D.

Static Analysis Tools (Linters)

Static analysis tools are those that automatically check over source code to find problems. These are called “Linters” in honor of the old “lint” tool for C on Unix since the 1980s. Getting to a warning-free compilation with your C++ compilers is like running a Linter for free, but there are some much more advanced static analysis tools, both free and commercial.

The idea of “warning-free compilation” can and should be extended to using Linters in your workflow. However, since these tools are more “picky” at finding stuff, they tend to emit too many warnings. Personally, I take a pragmatic non-purist view that you should focus on the warnings that are most likely to indicate a bug, rather than purely coding style issues (e.g. “function defined without a prior prototype declaration in a header file”).

You don't want programmers doing too much “busy work” fixing minor coding style warnings with little practical impact on code reliability. Hence, you might find that your policy needs to suppress some of the pickier warnings. And that'll be a fun meeting to have.

 

Next:

Up: Table of Contents

Buy: Generative AI in C++: Coding Transformers and LLMs

Generative AI in C++ The new AI programming book by Aussie AI co-founders:
  • AI coding in C++
  • Transformer engine speedups
  • LLM models
  • Phone and desktop AI
  • Code examples
  • Research citations

Get your copy from Amazon: Generative AI in C++