pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: Fix pg_size_bytes() to be more portable.
Date: Sat, 20 Feb 2016 10:08:53 -0500
Message-ID: <6029.1455980933@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEZATCWb+PEpsPi1w4MnnVSSs_y6OQJULRkjgXaj72ugOtLR7w@mail.gmail.com>
References: <E1aX5Rv-00022d-Gr@gemulon.postgresql.org>
	<5432.1455980047@sss.pgh.pa.us>
	<CAEZATCWb+PEpsPi1w4MnnVSSs_y6OQJULRkjgXaj72ugOtLR7w@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> On 20 February 2016 at 14:54, Tom Lane <tgl@sss.pgh.pa.us> 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



view thread (8+ messages)  latest in thread

Message-ID: <6029.1455980933@sss.pgh.pa.us>
Permalink:  ../6029.1455980933@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6029.1455980933@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dean.a.rasheed@gmail.com
  Subject: Re: pgsql: Fix pg_size_bytes() to be more portable.
  In-Reply-To: <6029.1455980933@sss.pgh.pa.us>
  References: <E1aX5Rv-00022d-Gr@gemulon.postgresql.org> <5432.1455980047@sss.pgh.pa.us> <CAEZATCWb+PEpsPi1w4MnnVSSs_y6OQJULRkjgXaj72ugOtLR7w@mail.gmail.com> <6029.1455980933@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox