Re: Does getopt() return "-1", or "EOF", at end?

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Does getopt() return "-1", or "EOF", at end?
Дата
Msg-id Pine.LNX.4.30.0201091604370.734-100000@peter.localdomain
обсуждение исходный текст
Ответ на Does getopt() return "-1", or "EOF", at end?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane writes:

> 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?

Definitely "-1", since getopt() comes from unistd.h and EOF is in stdio.h
so EOF is not necessarily available unless the program does stream-based
I/O.

-- 
Peter Eisentraut   peter_e@gmx.net



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Doug McNaught
Дата:
Сообщение: Re: Does getopt() return "-1", or "EOF", at end?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Does getopt() return "-1", or "EOF", at end?