Re: [RFC] Splitting kernel headers and deprecating __KERNEL__

Linus Torvalds
2004-12-14T19:59:17Z

On Tue, 14 Dec 2004, Sam Ravnborg wrote:
>
> Today we only pull in stdarg.h from userspace - actually a compiler
> dependent file.

Indeed. You'll notice that gcc doesn't even put stdarg.h in /usr/include,
it's in the compiler-specific header file directory, usually something
like /usr/lib/gcc-lib/<vendor>/<version>/include.

We used to compile with "-nostdinc" to make sure that you couldn't include
user files even by mistake, but that was removed for some reason I can't
for the life of me remember any more.

We probably should do it again. Something vaguely like

CFLAGS += -nostdinc -I $(CC -print-file-name=include)

should do it (and still pick up "stdarg.h").

Linus