> On Thu, 2003-01-09 at 20:06, Eric Weigle wrote:
> > I'm making a loadable module that will send IP packets; and need to
> > do IP
> > checksums. Unfortunately a simple #include of checksum.h fails
> > because that
> > file does not itself include the headers required to compile
> > correctly.
> > Several of the arch-specific files are this way.
> Include the other files you need first. The kernel headers are not
> really intended to always include everything you might want. That
> rapidly becomes unmanagable
These files include the ipv6 and VERIFY_* stuff unconditionally. _EVERY_
caller must know to include the in6.h/uaccess.h header files simply to get
it to compile. This is what the net/checksum.h file does. There are 31 files
including <asm/checksum.h> directly, and all of these _must_ track down the
dependencies by hand.
This isn't a _want_, it's an unconditional requirement. The files are broken.
<flamebait>
Of course, it's really C's bug, by doing brain-dead textual inclusion.
Trust me, I know the difficulties in managing #includes.
</flamebait>
-Eric
-- ------------------------------------------------------------ Eric H. Weigle -- http://public.lanl.gov/ehw/ "They that can give up essential liberty to obtain a little temporary safety deserve neither" -- Benjamin Franklin ------------------------------------------------------------ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Wed Jan 15 2003 - 22:00:30 EST