Does getopt() return "-1", or "EOF", at end? - Mailing list pgsql-hackers

From Tom Lane
Subject Does getopt() return "-1", or "EOF", at end?
Date
Msg-id 8213.1010599125@sss.pgh.pa.us
Whole thread Raw
Responses Re: Does getopt() return "-1", or "EOF", at end?  ("Dominic J. Eidson" <sauron@the-infinite.org>)
Re: Does getopt() return "-1", or "EOF", at end?  (Peter Eisentraut <peter_e@gmx.net>)
Re: Does getopt() return "-1", or "EOF", at end?  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Does getopt() return "-1", or "EOF", at end?  (David Terrell <dbt@meat.net>)
List pgsql-hackers
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?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Doug Royer
Date:
Subject: Re: Some architectures need "signed char" declarations
Next
From: Tom Lane
Date:
Subject: Re: Some architectures need "signed char" declarations