Re: pgsql: Provide overflow safe integer math inline functions.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pgsql: Provide overflow safe integer math inline functions.
Дата
Msg-id 22109.1513474261@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pgsql: Provide overflow safe integer math inline functions.  (Andres Freund <andres@anarazel.de>)
Ответы Re: pgsql: Provide overflow safe integer math inline functions.  (Andres Freund <andres@anarazel.de>)
Список pgsql-committers
Andres Freund <andres@anarazel.de> writes:
> I'm not quite following. Could you check if the same happens without
> -O2? Not because that'd be a solution, but to narrow down how this
> happens?

The committed test looks quite broken to me: it's missing some &
operators.  Not sure how that translates into failing to fail the
configure test, but personally I'd have done this like

volatile PG_INT64_TYPE a = 1;
volatile PG_INT64_TYPE b = 1;
PG_INT64_TYPE result;
__builtin_mul_overflow(a, b, &result);

            regards, tom lane


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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: pgsql: Provide overflow safe integer math inline functions.
Следующее
От: Andres Freund
Дата:
Сообщение: Re: pgsql: Provide overflow safe integer math inline functions.