Re: BUG #16790: Integer overflow not detected with <<

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #16790: Integer overflow not detected with <<
Дата
Msg-id 710063.1608737396@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #16790: Integer overflow not detected with <<  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #16790: Integer overflow not detected with <<  (Alexander Lakhin <exclusion@gmail.com>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> It seems that the bitwise shift left operator ignores overflow:
> Is this an expected behavior (a kind of UB)? It's not like an arithmetic
> shift. (The semantic of '1::int4<<-1' is questionable too.)

It's defined to do whatever the C << operator does.  That will certainly
not involve throwing an error.

            regards, tom lane



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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #16790: Integer overflow not detected with <<
Следующее
От: Alexander Lakhin
Дата:
Сообщение: Re: BUG #16790: Integer overflow not detected with <<