Re: Change atoi to strtol in same place
| От | Tom Lane |
|---|---|
| Тема | Re: Change atoi to strtol in same place |
| Дата | |
| Msg-id | 15840.1570654287@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Change atoi to strtol in same place (David Rowley <david.rowley@2ndquadrant.com>) |
| Список | pgsql-hackers |
David Rowley <david.rowley@2ndquadrant.com> writes:
> On Tue, 8 Oct 2019 at 19:46, Joe Nelson <joe@begriffs.com> wrote:
>> David Rowley wrote:
>>> The translation string here must be consistent over all platforms. I
>>> think this will cause issues if the translation string uses %ld and
>>> the platform requires %lld?
>> A very good and subtle point. I'll change it to %lld so that a single
>> format string will work everywhere.
> The way to do this is to make a temp buffer and snprintf into that
> buffer then use %s.
We have done it that way in the past, but it was mainly because we
couldn't be sure that snprintf was on board with %lld. I think that
the new consensus is that forcing use of "long long" is a less messy
solution (unless you need to back-patch the code). See commit
6a1cd8b92 for recent precedent.
regards, tom lane
В списке pgsql-hackers по дате отправления: