As per this document: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdlib.h.html stdlib.h should define W* macros like WEXITSTATUS etc. However, it doesn't. On 10-STABLE, I get: (21:13) novel@kloomba:~ %> cat stdlib_wmacros.c #include <stdlib.h> #ifndef WEXITSTATUS # error WEXITSTATUS not defined #endif (21:13) novel@kloomba:~ %> cc -c stdlib_wmacros.c stdlib_wmacros.c:4:3: error: WEXITSTATUS not defined # error WEXITSTATUS not defined ^ 1 error generated. (21:13) novel@kloomba:~ %> The same test on Fedora 18: (12:17) novel@localhost:~ %> cat stdlib_wmacros.c #include <stdlib.h> #ifndef WEXITSTATUS # error WEXITSTATUS not defined #endif (12:17) novel@localhost:~ %> gcc -c stdlib_wmacros.c (12:18) novel@localhost:~ %>
FWIW, this is even documented in FreeBSD's stdlib.h :) /* XXX XSI requires pollution from <sys/wait.h> here. We'd rather not. */ Yes, I know this doesn't help you much; I'm just trying to point out that, well, this is not an accidental omission, but a deliberate design decision. For the reasons for it you'll have to ask the people who did it - this particular text seems to have been added by Garrett Wollman back in 2002, but I think that he was just documenting the status quo rather than making a decision right there and then. G'luck, Peter -- Peter Pentchev roam@ringlet.net roam@FreeBSD.org p.penchev@storpool.com PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint 2EE7 A7A5 17FC 124C F115 C354 651E EFB0 2527 DF13 This sentence claims to be an Epimenides paradox, but it is lying.
Thanks for pointing that out, I didn't notice that comment. Anyway, I found the commit that introduces this comment: http://svnweb.freebsd.org/base/head/include/stdlib.h?annotate=103728 Unfortunately, commit message doesn't provide reasoning about that. I've CCed wollman@. Roman Bogorodskiy
In IEEE Std.1003.1-2001 (SUSv6), those macros were marked as XSI extensions. FreeBSD does not claim to implement XSI (which mostly memorializes old System V mistakes that the vendors who control The Open Group were unwilling to give up on). In IEEE Std.1003.1-2008 (SUSv7), they are marked CX (mandatory C extensions) instead. The change history is unhelpful; I've sent a query to the Austin Group list asking if anyone can recall why this change was made. -GAWollman
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped