After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 648206 - Standard includes in posix profile
Standard includes in posix profile
Status: RESOLVED INVALID
Product: vala
Classification: Core
Component: Code Generator
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-04-19 12:53 UTC by pancake
Modified: 2011-04-19 13:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description pancake 2011-04-19 12:53:38 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.
Comment 1 Jürg Billeter 2011-04-19 13:06:59 UTC
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