Re: Operands don't affect result (CONSTANT_EXPRESSION_RESULT) (src/backend/utils/adt/jsonfuncs.c)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Operands don't affect result (CONSTANT_EXPRESSION_RESULT) (src/backend/utils/adt/jsonfuncs.c)
Дата
Msg-id 1340553.1613018768@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Operands don't affect result (CONSTANT_EXPRESSION_RESULT) (src/backend/utils/adt/jsonfuncs.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Ответы Re: Operands don't affect result (CONSTANT_EXPRESSION_RESULT) (src/backend/utils/adt/jsonfuncs.c)  (Ranier Vilela <ranier.vf@gmail.com>)
Список pgsql-hackers
Ranier Vilela <ranier.vf@gmail.com> writes:
> *long* 4 *long int*, *signed long int* -2.147.483.648 a 2.147.483.647
> Therefore long never be > INT_MAX at Windows 64 bits.
> Thus lindex is always false in this expression:
> if (errno != 0 || badp == c || *badp != '\0' || lindex > INT_MAX ||  lindex
>  < INT_MIN)

Warnings about this are purest nanny-ism.

At the same time, I think this code could be improved; but the way
to do that is to use strtoint(), rather than kluging the choice of
datatype even further.

            regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Some regular-expression performance hacking
Следующее
От: Greg Nancarrow
Дата:
Сообщение: Re: Parallel INSERT (INTO ... SELECT ...)