Subject: Re: problems with arpa/inet.h
To: Greg A. Woods <>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: current-users
Date: 06/14/1998 21:47:04
Nested includes are here to stay.

On some NetBSD ports, include files under <machine/> do an #include of
a cpuarch-specific file. Check out sys/arch/{pmax,newsmips,pica,}/*.h.
For example, pmax/pte.h just does
    #include <mips/pte.h>

I think m68k machines use a similar trick for endian.h and float.h.

You cannot just pull the includes directly into application files,
because they use machine- and machien-arch dependent namespace: which
won't work on another machine.  The extra level of indirecton is

Since it reaches into <sys/types.h>, it's pretty pervasive.  
And those specific nested includes are not going to go away.

I think you have to give up on the purely-religious war against nested
includes, and start taking an engineering approach.  At which point, I
think we need a better set of guidelines -- for which nested includes
are OK, and which we should eliminate, or not document, or whatever --
than I've seen so far.