On Fri, Apr 11, 2014 at 7:02 PM, Ralph Siegler <[email protected]> wrote:
> On Thu, 10 Apr 2014 21:55:13 -0700, Philip Guenther wrote:
>
>> 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
>
> Well Philip, had we mentioned any POSIX 2008.1 certified or compliant OS
> in this thread that would be an interesting point to bring up.  But
> neither GNU/Linux, OpenBSD, nor FreeBSD is fully compliant.
>
> On the other hand, Mac OSX Mavericks is 100% compliant and certified, and
> per spec has, for example, sem_init and sem_destroy in the header
> files.......but lo and behold doesn't actually implement them in the
> libraries.  This and similar show-without-go has bummed out more than one
> code porter.
>
> Meanwhile, OpenBSD doesn't have the 100% 2008.1 beef stamp on its hind
> quarters but will compile and run code having those functions......which
> is better?

Yes, de facto standards can be important.

Now, does this issue in particular--namely, the decision of which
header declares getopt()--merit reconsideration? Should OpenBSD or
another OS depart from POSIX in this regard? If so, what is the
motivation?

>
>
> Ralph
>

Reply via email to