I'm pretty sure Dennis Ritchie at some point himself said that not including a linter was a mistake, but I cannot find a quote of this with a quick search.
In defense: configuring a package that is compiled by lots of people on lots of machines with lots of versions of various compilers requires a lot of attention to warning flags and such. If you aren't starting out a package from a blank buffer it's very hard to get this right.
But I am frequently shocked by the number of compiler warnings I get from code downloaded from public repos and compiled in precisely the environments it's been documented to have been tested on.
"To encourage people to pay more attention to the official language rules, to detect legal but suspicious constructions, and to help find interface mismatches undetectable with simple mechanisms for separate compilation, Steve Johnson adapted his pcc compiler to produce lint [Johnson 79b], which scanned a set of files and remarked on dubious constructions."
Does depend on what kind of lint you want to catch but something like this 'just' needs some lexing and parsing to give a usable AST that's reasonably clean so it's not too hard to write lint rules against it. (Not trivial for C & C++ hence 'just')
Building the full compiler is much more work, especially if you want a decent optimizing compiler.
In fact most of the essential complexity is in the front end; you make do with a simple back end, but the front end is irreducibly complex if you want it to actually compile the language to spec.
And you need the front end to lint, especially if you want to avoid false positives, the bane of linting tools.
[1] http://blog.reverberate.org/2013/08/parsing-c-is-literally-u...
A test passing just means that the code and the test agree, not necessarily that both are correct.
Every external tool is a lost opportunity for quality enforcement.
https://docs.microsoft.com/en-us/visualstudio/code-quality/u...
Just making the point that they have been largely ignored.
Ever heard of PC Lint from Gimpel? It was my first one.
Or do you think I would be critic of how many use C, without adopting best practices myself?
One learns a lot about code quality, or lack thereof, when doing enterprise consulting.
Pure truth, there. One has seen neither really awful code nor really great code until they have seen the wide array of code quality produced by an enterprise with a few decades of software development history. Any enterprise will suffice, it doesn't have to be a huge corporate entity.
There are a very few developers who are really good and who really care, and there are very few who really do not care and who are really not good, and most are somewhere in between.
Check "Which of the following tools do you or your team use for guideline enforcement or other code quality/analysis?" results.
Some may even have released code that still has these time bombs waiting to occur.