On Wed, Jan 09, 2002 at 12:58:45PM -0500, Tom Lane wrote:
> I notice that in some places we compare the result of getopt(3) to
> "EOF", and in some other places we compare it to "-1". I think we
> should standardize on one or the other; anyone have an opinion
> which it should be?
>
> The man pages I have here (HPUX and Linux) both describe the
> end-of-switches return value as being "-1". The glibc sources also
> use "-1". Replacing this by EOF seems more readable but perhaps is
> not strictly correct.
>
> Are there any platforms that define EOF as something other than -1?
OpenBSD's getopt(3): The getopt() function was once specified to return EOF instead of -1. This was changed by
IEEEStd1003.2-1992 (``POSIX.2'') to decouple getopt() from <stdio.h>.
--
David Terrell | "If NNTP had a protocol extension for
dbt@meat.net | administering a spanking (long overdue if
Nebcorp Prime Minister | you ask me), you'd be yelping right now."
http://wwn.nebcorp.com/ | - Miguel Cruz