標準カーネルヘッダでの問題例

例: ユーザプログラムでcdromを使いたい(i386)

> cat test.c
 #include <linux/cdrom.h>
 int main(void) { return 0; }
> gcc test.c
> gcc test.c -ansi
In file included from /usr/include/linux/cdrom.h:14,
                 from cdrom.c:1:
/usr/include/asm/byteorder.h:28: error: syntax error before "___arch__swab64"
/usr/include/asm/byteorder.h:28: error: syntax error before "val"
...

この場合はコンパイラオプションが問題の原因
実際はカーネルヘッダがユーザランドを考えないで起こる問題が多い (#ifdef __KERNEL__)