Re: Portability concerns over pq_sendbyte?

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Portability concerns over pq_sendbyte?
Date: 2018-06-27 06:51:49
Message-ID: 20180627065149.tdczk7my43mekh7g@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2018-06-14 13:25:30 -0700, Andres Freund wrote:
> On 2018-06-14 16:17:28 -0400, Tom Lane wrote:
> > Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> > > How about not renaming the functions, but just change argument types?
>
> Yea, I'm in favor of this. I don't think the 'u' in there would benefit
> us, and the cast from signed to unsigned is well defined, so it's safe
> to call the functions with signed input.

Nobody argued against, thus I've pushed a patch doing so.

Looking at surrounding code I found a few more oddities, but of older
vintage:
- pq_sendfloat4 uses an uint32 in the union, but float8 uses a int64.
- same with pq_getmsgfloat[48]
- pq_getmsgint64 returns a int64, should probably also be uint64

Given they're practially harmless I'm inclined to only fix them in
master?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2018-06-27 06:58:20 Re: [HACKERS] advanced partition matching algorithm for partition-wise join
Previous Message Amit Langote 2018-06-27 06:45:23 Re: postgresql_fdw doesn't handle defaults correctly