[MPlayer-dev-eng] [RFC] port 'make checkheaders' from FFmpeg

Uoti Urpala uoti.urpala at pp1.inet.fi
Sat Mar 1 00:28:34 CET 2008


On Sat, 2008-03-01 at 00:49 +0200, Ivan Kalvachev wrote:
> On Wed, Feb 27, 2008 at 4:32 PM, Uoti Urpala <uoti.urpala at pp1.inet.fi> wrote:
> >  There would be no error or warning on the developer's machine.
> 
> It doesn't matter on whom machine it is, the bug would be triggered,
> found and fixed.

That's true of any "missing header" bug that occurs in practice, in any
model. Albeu's mail had an example where a missing include would go
unnoticed on a developer's machine if he had a different configuration.
In my reply I gave an example which showed that such problems can happen
just as well if headers don't include other headers, and are in fact
harder to spot in that case. Your comments on this have been incoherent.
I'm not sure what exactly you're trying to argue here. 

> Actually after rereading your original statement I find it wrong. The
> compiler would output the error header and the error .c file where
> this header is used. You have all the info you need to fix the bug.

I'm not sure how you're reading it, but the problematic part is under
#if 0 on the developer's box so the compiler really shouldn't give
errors from it...

> >  It's much easier still to forget a header required recursively by
> >  another header if that causes no warnings or errors on your machine. You
> >  didn't really address the main point of what I said: it is much more
> >  realistic to manually maintain an accurate list of headers for a file
> >  than for a file PLUS recursive dependencies.
> 
> In the end you are having headers that include every other header. And

Only if you do it badly. And a "flat" system can lead to files that
include every header, and are much harder to clean up.

> if something goes wrong you don't have even the slightest idea in what
> order the headers have been included.

I don't know about you, but I wouldn't expect that to be a problem for
myself or most other developers.

> When you have flat system, headers should not include other headers,
> there should be no recursive dependencies at all.

What I mean by "recursive dependencies" above are headers required
because of other headers. Those still exist whether they're actually
included by the depending headers or not. Such a "flat" system just
makes maintaining an accurate list of the header dependencies more
difficult.




More information about the MPlayer-dev-eng mailing list