tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: proposal: remove traditional C support from lint
On Wed, Mar 17, 2021 at 02:32:25PM +0100, Hauke Fath wrote:
> On Wed, 17 Mar 2021 00:55:03 +0100, Roland Illig wrote:
> > when I run lint with the -t flag for traditional C (which means before
> > C90), I always get these warnings:
> >
> > [...]
>
> > Any objections to removing the -t flag and everything that belongs to it?
>
> It seems to me the flag does what's advertised.
>
> As Valery said, modern compilers do well on their own, so the question
> would be whether being able to lint validate code as K&R compliant is
> of any value.
I see negative value in supporting K&R. I generally see negative value
in working on our lint -- there are much more advanced tools that cover
the majority of the lint functionality much better. So I would really
prefer that any time spend on lint-functionality would go into covering
the holes of what existing tools provide. The two big items I can think
off:
(1) Checking the consistency of function ABIs across files.
(2) Checking the consitency of type ABIs across files.
Prototypes supposedly fixed the first, but it is still possible to have
a prototype in a.c and a definition in b.c and they don't match. Lint
libraries kind of cover that, but they come with their own problems. A
much better approach IMO would be to parse the DWARF records and base a
tool on that. Similarly, for (2), check that types of the same name are
compatible. It's perfectly fine to have multiple definitions of the same
type in different places, as long as they are consistent with each
other. Again, the DWARF records have all the data necessary. The
interesting part is that both can be done without having to parse and
analyze the frontend language. There are existing ABI validation tools
for ELF that might provide a useful starting here.
Joerg
Home |
Main Index |
Thread Index |
Old Index