public inbox for [email protected]  
help / color / mirror / Atom feed
From: Heikki Linnakangas <[email protected]>
To: Thomas Munro <[email protected]>
To: Peter Eisentraut <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Japin Li <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Cannot find a working 64-bit integer type on Illumos
Date: Tue, 2 Jul 2024 16:34:57 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+hUKGKXEdVSfR6UHXfR3tSQ+TfBNk-ssYmO2F0wCdw7qcx86Q@mail.gmail.com>
References: <ME3P282MB3166F9D1F71F787929C0C7E7B6312@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM>
	<[email protected]>
	<ME3P282MB3166D876E9CB83009727A5ECB6312@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM>
	<[email protected]>
	<CA+hUKG+CR05ACFujUbeAd-yM+nNJBSpnyB=q3vbriCJuoSu9Ag@mail.gmail.com>
	<[email protected]>
	<CA+hUKG+ZwX-reVMHak3yo-63rrh9AJwEVGW4rCbsoLeSKO54Pg@mail.gmail.com>
	<[email protected]>
	<CA+hUKGKXEdVSfR6UHXfR3tSQ+TfBNk-ssYmO2F0wCdw7qcx86Q@mail.gmail.com>

On 18/04/2024 23:29, Thomas Munro wrote:
> On Thu, Apr 18, 2024 at 8:47 PM Peter Eisentraut <[email protected]> wrote:
>> I'm not sure I understand the problem here.  Do you mean that in theory
>> a platform's PRId64 could be something other than "l" or "ll"?
> 
> Yes.  I don't know why anyone would do that, and the systems I checked
> all have the obvious definitions, eg "ld", "lld" etc.  Perhaps it's an
> acceptable risk?  It certainly gives us a tidier result.

Could we have a configure check or static assertion for that?

> For discussion, here is a variant that fully embraces <inttypes.h> and
> the PRI*64 macros.

Looks good to me.

Personally, I find "PRId64" pretty unreadable. "INT64_MODIFIER" wasn't 
nice either, though, and following standards is good, so I'm sure I'll 
get used to it.

They're both less readable than INT64_FORMAT and "%lld", which we use in 
most places, though. Perhaps "%lld" and casting the arguments to "long 
long" would be more readable in the places where this patch replaces 
INT64_MODIFIER with PRI*64, too.

-- 
Heikki Linnakangas
Neon (https://neon.tech)







view thread (10+ messages)

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Cannot find a working 64-bit integer type on Illumos
  In-Reply-To: <[email protected]>

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

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