Re: Change atoi to strtol in same place

Поиск
Список
Период
Сортировка
От Kyotaro Horiguchi
Тема Re: Change atoi to strtol in same place
Дата
Msg-id 20191001.193208.264851337.horikyota.ntt@gmail.com
обсуждение исходный текст
Ответ на Re: Change atoi to strtol in same place  (Joe Nelson <joe@begriffs.com>)
Ответы Re: Change atoi to strtol in same place
Список pgsql-hackers
Hello.

At Sun, 29 Sep 2019 23:51:23 -0500, Joe Nelson <joe@begriffs.com> wrote in <20190930045123.GC68117@begriffs.com>
> Alvaro Herrera wrote:
> > ... can we have a new patch?
> 
> OK, I've attached v4. It works cleanly on 55282fa20f with
> str2int-16.patch applied. My patch won't compile without the other one
> applied too.
> 
> Changed:
> [x] revert my changes in common/Makefile
> [x] rename arg_utils.[ch] to option.[ch]
> [x] update @pgfeutilsfiles in Mkvcbuild.pm
> [x] pgindent everything
> [x] get rid of atoi() in more utilities

Compiler complained as "INT_MAX undeclared" (gcc 7.3 / CentOS7.6).

> One question about how the utilities parse port numbers.  I currently
> have it check that the value can be parsed as an integer, and that its
> range is within 1 .. (1<<16)-1. I wonder if the former restriction is
> (un)desirable, because ultimately getaddrinfo() takes a "service name
> description" for the port, which can be a name such as found in
> '/etc/services' as well as the string representation of a number. If
> desired, I *could* treat only range errors as a failure for ports, and
> allow integer parse errors.

We could do that, but perhaps no use for our usage. We are not
likely to use named ports other than 'postgres', if any.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Change atoi to strtol in same place