[9fans] C style

  • Follow


i suppose it is a bad manner to #include foo1.h from within foo.h
is it?

++pac.



--=20
Levn=ECj=B9=ED internet v pracovn=ED dny ji=BE od 18:00 hod.
Surfujte s VOLN=DD!
http://mimospicku.volny.cz

0
Reply pac7 (25) 5/4/2005 4:33:21 AM

pac7@post.cz wrote:
> i suppose it is a bad manner to #include foo1.h from within foo.h
> is it?

Not as such.  If foo1.h defines the interface to some
resources that foo.h needs, then it *ought* to be
#included, so that the user of foo.h doesn't need to
know implementation details.  For example, if foo.h
declares a structure maintained by functions in the
"foo" package (also declared by foo.h) and that
structure has a private member that is a Boolean
flag, foo.h ought to be #including <stdbool.h> so
that it can use the proper type for "bool".  This
is generic advice, and the Plan9 developers seem to
disagree (for no good reason so far as I have heard).
0
Reply DAGwyn (793) 5/4/2005 9:49:32 AM


1 Replies
32 Views

(page loaded in 0.091 seconds)


Reply: