pgsql: Return implementation defined value if pg_$op_s$bit_overflowove

Поиск
Список
Период
Сортировка
От Andres Freund
Тема pgsql: Return implementation defined value if pg_$op_s$bit_overflowove
Дата
Msg-id E1em5ZI-00036B-VZ@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Return implementation defined value if pg_$op_s$bit_overflow overflows.

Some older compilers otherwise sometimes complain about undefined
values, even though the return value should not be used in the
overflow case.  We assume that any decent compiler will optimize away
the unnecessary assignment in performance critical cases.

We do not want to restrain the returned value to a specific value,
e.g. 0 or the wrapped-around value, because some fast ways to
implement overflow detecting math do not easily allow for
that (e.g. msvc intrinsics).  As the function documentation already
documents the returned value in case of intrinsics to be
implementation defined, no documentation has to be updated.

Per complaint from Tom Lane and his buildfarm member prairiedog.

Author: Andres Freund
Discussion: https://postgr.es/m/18169.1513958454@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6d7dc5350042697bbb141a7362649db7fa67bd55

Modified Files
--------------
src/include/common/int.h | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Silence assorted "variable may be used uninitialized" warnings.
Следующее
От: Andres Freund
Дата:
Сообщение: Re: pgsql: Use new overflow aware integer operations.