Re: Reliance on undefined behaviour in << operator

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Reliance on undefined behaviour in << operator
Дата
Msg-id 6201.1442433424@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Reliance on undefined behaviour in << operator  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Reliance on undefined behaviour in << operator  (Robert Haas <robertmhaas@gmail.com>)
Re: Reliance on undefined behaviour in << operator  (Andres Freund <andres@anarazel.de>)
Re: Reliance on undefined behaviour in << operator  ("ktm@rice.edu" <ktm@rice.edu>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Sep 16, 2015 at 3:16 AM, Craig Ringer <craig@2ndquadrant.com> wrote:
>> Our implementation of << is a direct wrapper around the C operator. It
>> does not check the right-hand side's value.
>> ... On x64 intel gcc linux it does a rotation but that's
>> not AFAIK guaranteed by anything, and we should probably not be
>> relying on this or exposing it at the user level.

> I agree.

As far as I'm concerned, what those operators mean is "whatever your
compiler makes them mean".  This is hardly the only place where we expose
platform-dependent behavior --- see also locale dependencies, timezones,
floating point, yadda yadda --- and I do not find it the most compelling
place to start reversing that general approach.
        regards, tom lane



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Reliance on undefined behaviour in << operator
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: pg_resetxlog sentences