Re: Does getopt() return "-1", or "EOF", at end?
От | David Terrell |
---|---|
Тема | Re: Does getopt() return "-1", or "EOF", at end? |
Дата | |
Msg-id | 20020109132949.A8808@pianosa.catch22.org обсуждение исходный текст |
Ответ на | Does getopt() return "-1", or "EOF", at end? (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Does getopt() return "-1", or "EOF", at end?
|
Список | pgsql-hackers |
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
В списке pgsql-hackers по дате отправления: