Re: pgsql: Remove byte-masking macros for Datum conversion macros

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Remove byte-masking macros for Datum conversion macros
Date: 2018-02-02 14:52:32
Message-ID: 15659.1517583152@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Remove byte-masking macros for Datum conversion macros

Looking at the code now, I think there's at least one bad outcome of
this change: the behavior of CharGetDatum() is now ill-defined, because
we'll (probably) get different results on signed-char and unsigned-char
compilers. I think we'd be well advised to make that macro be

#define CharGetDatum(X) ((Datum) ((unsigned char) (X)))

regards, tom lane

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2018-02-02 18:37:11 pgsql: Support parallel btree index builds.
Previous Message Robert Haas 2018-02-02 14:32:55 pgsql: Refactor code for partition bound searching