Portability concerns over pq_sendbyte?

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Portability concerns over pq_sendbyte?
Дата
Msg-id 87r2m10zm2.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответы Re: Portability concerns over pq_sendbyte?  (Michael Paquier <michael@paquier.xyz>)
Re: Portability concerns over pq_sendbyte?  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: Portability concerns over pq_sendbyte?  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
In PG11, pq_sendbyte got changed from taking an int parameter to taking
an int8.

While that seems to work in general, it does mean that there are now
several places in the code that do the equivalent of:

    unsigned char x = 128;
    pq_sendbyte(&buf, x);

which I believe is not well-defined since pq_sendbyte takes an int8, and
conversions of unrepresentable values to _signed_ integer types are
(iirc) implementation-dependent.

There are also some cases where pq_sendint16 is being called for an
unsigned value or a value that might exceed 32767.

Would it be better for these to take unsigned values, or have unsigned
variants?

-- 
Andrew (irc:RhodiumToad)


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Should we add GUCs to allow partition pruning to be disabled?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: A Japanese-unfriendy error message contruction