Re: Change atoi to strtol in same place

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Change atoi to strtol in same place
Дата
Msg-id 20190724051627.GF14257@paquier.xyz
обсуждение исходный текст
Ответ на Re: Change atoi to strtol in same place  (David Rowley <david.rowley@2ndquadrant.com>)
Ответы Re: Change atoi to strtol in same place  (Alvaro Herrera from 2ndQuadrant <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
On Wed, Jul 24, 2019 at 04:57:42PM +1200, David Rowley wrote:
> I'd like to put my vote not to add this complex code to each option
> validation that requires an integer number. I'm not sure there
> currently is a home for it, but if there was, wouldn't it be better
> writing a function that takes a lower and upper bound and sets some
> output param with the value and returns a bool to indicate if it's
> within range or not?

Perhaps.  When I see this patch calling strtol basically only for 10
as base, this reminds me of Fabien Coelho's patch refactor all the
strtoint routines we have in the code:
https://commitfest.postgresql.org/23/2099/

The conclusion that we are reaching on the thread is to remove more
dependencies on strtol that we have in the code, and replace it with
our own, more performant wrappers.  This thread makes me wondering
that we had better wait before doing this move.
--
Michael

Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Change atoi to strtol in same place
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: On the stability of TAP tests for LDAP