This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Any idea what this is for? (fixincludes for svr4, _KERNEL)


neroden@twcny.rr.com (Nathanael Nerode)  wrote on 26.07.03 in <20030726043251.GA995@twcny.rr.com>:

> The following code is in fixinc.svr4.  It wraps entire files with
> #if _KERNEL.  What I can't figure out is *WHY*.  Is this just obsolete
> cruft, or is there a known reason for it?

> # Conditionalize all of <fs/rfs/rf_cache.h> on _KERNEL being defined.
(etc)

I can only <guess>, but it may be analoguous to the Linux <linux/*> and  
<asm/*> stuff.

That is, these are kernel headers that get included (sometimes very  
indirectly) from user-level headers to get at some constants and structs,  
and while doing that expose other kernel-internal stuff that really  
shouldn't come out of those user-level headers - including whole include  
files.

If it is that, then this would be the same as removing all includes of  
these files from all places where they happen, as an alternate strategy.  
That change may not be feasible, of course.

The #ifdef _KERNEL, of course, is so if you *do* need to get at that  
stuff, you can; and those that need it probably already do define _KERNEL  
because there are other places needing it.

</guess>

MfG Kai


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]