Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ehchk-0003fT-Mv for pgsql-committers@arkaria.postgresql.org; Fri, 02 Feb 2018 14:52:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehchj-0004iA-HL for pgsql-committers@arkaria.postgresql.org; Fri, 02 Feb 2018 14:52:39 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ehchj-0004i0-9G for pgsql-committers@lists.postgresql.org; Fri, 02 Feb 2018 14:52:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ehchg-0007wb-W9 for pgsql-committers@postgresql.org; Fri, 02 Feb 2018 14:52:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w12EqWcm015660; Fri, 2 Feb 2018 09:52:32 -0500 From: Tom Lane To: Peter Eisentraut cc: pgsql-committers@postgresql.org Subject: Re: pgsql: Remove byte-masking macros for Datum conversion macros In-reply-to: References: Comments: In-reply-to Peter Eisentraut message dated "Fri, 26 Jan 2018 14:20:54 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15658.1517583152.1@sss.pgh.pa.us> Date: Fri, 02 Feb 2018 09:52:32 -0500 Message-ID: <15659.1517583152@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Eisentraut 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