tech-toolchain archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: proposal: remove traditional C support from lint
On 17.03.2021 09:07, Valery Ushakov wrote:
On Wed, Mar 17, 2021 at 00:55:03 +0100, Roland Illig wrote:
Frankly, with modern compilers I don't see much (any, more like) point
of using lint on modern code. Playing catch up with gcc extensions
doesn't add much value compared to gcc/clang.
I definitely won't spend any time on adding lint checks that are already
covered by current GCC or Clang.
One thing I was missing though from these two was something I called
'strict bool mode', and it was quite easy to implement in lint. The
basic idea is that bool is incompatible with all other scalar types,
just as in Java or Go.
I applied this to make(1), lint(1) and cgram(6), since the code of these
programs _almost always_ used this style already, making the few
remaining instances stand out unnecessarily. This made the code
consistent in its usage of boolean variables.
Another thing is to check for GNU-specific C features such as
__FUNCTION__ (which is easy to avoid in C99), ({...}), array
initialization with [a...b], and so on. I don't think even GCC can
reliably detect these.
Another thing I added is a check whether the options string given to
getopt matches what the switch statement handles. This is something
that I didn't find elsewhere as well. Checking that the options string
follows the recommendations in share/misc/style might also be worth
adding, maybe under an option to check for NetBSD-specific rules.
These areas is where I see the value of lint.
Roland
Home |
Main Index |
Thread Index |
Old Index