Re: [dev] include files should never include include files?

From: anonymous <>
Date: Sat, 16 Jan 2010 20:18:26 +0300

On Sat, Jan 16, 2010 at 10:41:40AM -0500, Joseph Xu wrote:
> So my first question is, has anybody actually ran into problems due
> to violating this rule?

Sometimes there is two headers that depend on some third. First header
includes this third and the second header don't (you may forgot to do
it cause all compiles anyway). When you include header 2 after header 1
everything is ok, but if you rearrange them code won't compile cause
you forgot to include header 3 from header 2.

When all includes are in C files it is easy to see if there is no
double includes. Also if some #include is missed code won't compile. So
you never have more or less #include's than needed.
Received on Sat Jan 16 2010 - 17:18:26 UTC

This archive was generated by hypermail 2.2.0 : Sat Jan 16 2010 - 17:24:02 UTC