On Thu, Apr 10, 2014 at 7:14 PM, Ralph Siegler <[email protected]> wrote: > On Thu, 14 Nov 2013 23:17:24 -0500, Eitan Adler wrote: >> I was looking through some OpenBSD code and noticed that rs and jot are >> both missing #include <unistd.h> even though they use getopt. It seems >> that stdlib.h defines getopt on OpenBSD. However, this is not the >> correct header file, and it makes it not possible to compile OpenBSD's >> utilities on other platforms. > > I just looked on my linux box and found this in stdlib.h ... > So I'm wondering about your assertion that this is "not the correct > header file"....looking at links in your post, do you really mean "FreeBSD > doesn't define them there but everyone else on the planet might"?
He's perhaps referring to the POSIX standard, which specifies that that *in a conforming compilation environment* <unistd.h> MUST declare getopt() and <stdlib.h> MUST NOT declare getopt(). (Ya'll know that the current POSIX standard can be downloaded after a free registration, don'cha?) Philip Guenther
