Re: [RFC] Splitting kernel headers and deprecating __KERNEL__

From: Linus Torvalds
Date: Tue Dec 14 2004 - 15:00:30 EST




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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/