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

Ivan Kalvachev ikalvachev at gmail.com
Fri Feb 29 23:49:21 CET 2008


On Wed, Feb 27, 2008 at 4:32 PM, Uoti Urpala <uoti.urpala at pp1.inet.fi> wrote:
> On Wed, 2008-02-27 at 13:35 +0200, Ivan Kalvachev wrote:
>  > On Wed, Feb 27, 2008 at 6:19 AM, Uoti Urpala <uoti.urpala at pp1.inet.fi> wrote:
>
> > >  Bugs are harder to avoid in the latter case. It's more realistic to
>  > >  expect people to notice that file.c uses a definition but does not
>  > >  include the header, than to notice that foo.h uses a definition but
>  > >  file.c does not include the header.
>  >
>  > This is exactly what we want.
>  > We want to be harder to avoid bugs, so we can fix them easier.
>  > You will get error (or at least warning), you will find the missing
>  > header and you will know where to place it.
>
>  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.

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.


>  > >  The basic issue is simple: it's much more realistic to manually maintain
>  > >  an accurate list of what headers (and under what conditions) are
>  > >  required BY THIS FILE, than to manually maintain an accurate list of
>  >
>  > I've said before - This promotes sloppy coding. You can easily forget
>  > one of the headers required by this file, and if it is somehow already
>  > included  you may never notice.
>
>  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
if something goes wrong you don't have even the slightest idea in what
order the headers have been included.

When you have flat system, headers should not include other headers,
there should be no recursive dependencies at all.
Unfortunately many people have slowly eroded this and at the moment
MPlayer have rather ugly mix of both systems. And Diego's "clean up"
is pushing the things in the wrong direction, making the matter even
worse.



More information about the MPlayer-dev-eng mailing list