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

Aurelien Jacobs aurel at gnuage.org
Sat Mar 1 01:16:27 CET 2008


Uoti Urpala wrote:

> On Sat, 2008-03-01 at 00:49 +0200, Ivan Kalvachev wrote:
> 
> > 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.

Indeed !
Why would I care about the order the headers are included ?
With properly written recursive headers, the order of inclusion never
matter !
That's another disadvantage of the flat system: you must pay attention
to inclusion order.

IMO the primary goal of headers file is to avoid duplicating code.
Flat system means duplicating the properly ordered list of include
needed by foo.h in every file including foo.h instead of just
sticking this list inside foo.h. This just defeat the whole purpose
of header files.
If you don't care about duplication, you could just copy-paste the
whole content of foo.h in every .c files which need it.
Then you rm *.h and you are really done for good about the
#include placement fight.

Aurel



More information about the MPlayer-dev-eng mailing list