GNOME Bugzilla – Bug 648206
Standard includes in posix profile
Last modified: 2011-04-19 13:06:59 UTC
By default, the posix profile includes <stddef.h> which is a linux-ism. it doesnt works on OSX (between others). See the location of stddef in a standard linux distribution: /usr/include/linux/stddef.h in OSX, this include does not exists which results in no definition of NULL and other basic types for C. Here's a sample program which fails to compile in OSX. ==== using Posix; void main () { void *p = null; } ==== if we do print ("%p\n", p); then <stdio.h> is included..so it builds. Should we include stdio.h by default in posix profile instead of stddef? i dont know if stddef exists in windows or BSD. but would be good to test.
stddef.h is definitely not a Linux-ism. It's defined in ISO C. /usr/include/linux/stddef.h is not normally included, it's part of the kernel headers. The regular stddef.h is provided by the C compiler. You can find it in a place such as: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/include/stddef.h