grok _GNU_SOURCE?
To: Jaromir Dolecek <jdolecek@NetBSD.org>
From: Bruce Korb <bkorb@veritas.com>
List: tech-userlevel
Date: 10/23/2004 09:34:43
Jaromir Dolecek wrote:
>
> $subject says it pretty much all.
>
> The effect of _GNU_SOURCE should be pretty much equal to
> _NETBSD_SOURCE, e.g. expose all extensions. There is some software
> which defines _GNU_SOURCE along with _POSIX_C_SOURCE or _XOPEN_SOURCE,
> which fails to build due to not exposed prototypes.
>
> Yeah, _GNU_SOURCE is totally nonstandard, but supporting it would
> help porting 3rd party software written for Linux.
Sun:
__EXTENSIONS__
_XOPEN_SOURCE_EXTENDED
HP/UX:
_INCLUDE_XOPEN_SOURCE_EXTENDED
_XOPEN_SOURCE_EXTENDED
_INCLUDE_HPUX_SOURCE
_XPG4_EXTENDED
AIX:
_XOPEN_SOURCE_EXTENDED
Summary: _GNU_SOURCE is not non-standard. Everyone picks their own
standard, and GNU isn't any different. Personally, I just add every
new one I bump into. I'll be adding "_NETBSD_SOURCE" now, though
it *would* be nice if _GNU_SOURCE implied _NETBSD_SOURCE. :)
Cheers - Bruce