Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aX99m-0007xv-EX for pgsql-committers@arkaria.postgresql.org; Sat, 20 Feb 2016 15:09:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aX99l-0001eb-TD for pgsql-committers@arkaria.postgresql.org; Sat, 20 Feb 2016 15:09:13 +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_SHA384:256) (Exim 4.84) (envelope-from ) id 1aX99Z-0001R6-9x for pgsql-committers@postgresql.org; Sat, 20 Feb 2016 15:09:01 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aX99U-0001gO-Vn for pgsql-committers@postgresql.org; Sat, 20 Feb 2016 15:09:00 +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 u1KF8rjf006030; Sat, 20 Feb 2016 10:08:54 -0500 From: Tom Lane To: Dean Rasheed cc: pgsql-committers@postgresql.org Subject: Re: pgsql: Fix pg_size_bytes() to be more portable. In-reply-to: References: <5432.1455980047@sss.pgh.pa.us> Comments: In-reply-to Dean Rasheed message dated "Sat, 20 Feb 2016 15:02:40 +0000" Date: Sat, 20 Feb 2016 10:08:53 -0500 Message-ID: <6029.1455980933@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org Dean Rasheed writes: > On 20 February 2016 at 14:54, Tom Lane wrote: >> Project style is to use something like "(uint64) 1024" instead. > BTW, I found a couple of instances of 'LL' in ecpglib/prepare.c, which > is why I thought it was OK to use it. [ squint... ] Don't know how long that code has been there, but it's gratuitously unportable. Even if you grant that "long long" exists in the compiler, there's no promises whatever as to what width it is. This code looks to be assuming that it's int64, but just using int64 would be a better answer. BTW, I now remember that we have an INT64CONST macro in c.h, which would be another solution if you don't like the cast for some reason. regards, tom lane -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers