Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMx2c-0005jR-3A for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Nov 2018 15:25:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gMx2Z-0008Bj-2Q for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Nov 2018 15:25:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMx2Y-0008BY-RY for pgsql-hackers@lists.postgresql.org; Wed, 14 Nov 2018 15:25:14 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMx2S-0003RC-F8 for pgsql-hackers@postgresql.org; Wed, 14 Nov 2018 15:25:14 +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 wAEFP3re007674; Wed, 14 Nov 2018 10:25:03 -0500 From: Tom Lane To: Thomas Munro cc: Noah Misch , Pg Hackers Subject: Re: DSM segment handle generation in background workers In-reply-to: References: <17043.1539046409@sss.pgh.pa.us> <9879.1539233472@sss.pgh.pa.us> <20181112083358.GA1073796@rfd.leadboat.com> <32455.1542033541@sss.pgh.pa.us> <20181114022435.GC1096408@rfd.leadboat.com> <20181114053412.GD1096408@rfd.leadboat.com> Comments: In-reply-to Thomas Munro message dated "Wed, 14 Nov 2018 20:22:42 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7672.1542209103.1@sss.pgh.pa.us> Date: Wed, 14 Nov 2018 10:25:03 -0500 Message-ID: <7673.1542209103@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thomas Munro writes: > What do you think about the attached? I think you need to cast MyStartTimestamp to uint64 before shifting to ensure portable behavior of the shifts. In principle it wouldn't matter because the int64 sign bit is nowhere near the part we care about, but I've heard some pretty wild claims about what compiler writers are entitled to do with "undefined" cases. regards, tom lane