From: | Thomas Munro <thomas(dot)munro(at)gmail(dot)com> |
---|---|
To: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: 64 bit numbers vs format strings |
Date: | 2025-03-17 11:05:32 |
Message-ID: | CA+hUKG+Y29+OiTL6Q3SJA3fEgNX37TaUWaOmA_RWsjD01M0TZw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Mar 17, 2025 at 8:03 PM Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
> On 15.03.25 03:42, Thomas Munro wrote:
> > So we should make pgoff_t a typedef for int64_t everywhere. It's a
> > bit annoying that we have to teach everyone to remember to use PRId64
> > to print it, though.
>
> The ramifications of such a change are not clear to me. I thought
> pgoff_t is supposed to be off_t on Unix systems. If we change that,
> then how will this affect pointer type arguments, function pointers,
> etc. This seems to be a much larger problem than what this thread is
> originally about.
>
> I think we should leave pgoff_t the way it is (mostly?) done now: Cast
> to long long int and print using %lld.
WFM.
> > How reasonable would it be to add an extra
> > filter into whatever script is used to run xgettext on our source
> > tree? It could replace a very small number of agreed useful tokens to
> > match some macros that we would also define in our tree, so that we
> > could write PRI_PGOFF_T in our messages, but xgettext would see PRId64
> > and still emit those magic %<PRId64> tokens that GNU/NetBSD/Solaris
> > gettext() know how to translate on the fly when loading message
> > catalogues.
>
> This is not really possible. The <PRIxxx> behavior is baked deeply into
> the gettext code. (Also note that you don't only need support in
> xgettext, which is part of our build system, but also in the runtime
> library, which we don't control.)
Hmm, but that's why I was asking about filtering the source *before*
xgettext sees it, but it sounds like I may still be confused about how
that works and I'm very happy to abandon that idea and leave those
bits unchanged. Will update the patch shortly to incorporate your
other feedback.
Thanks!
From | Date | Subject | |
---|---|---|---|
Next Message | jian he | 2025-03-17 11:14:52 | Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints |
Previous Message | Daniil Davydov | 2025-03-17 10:56:04 | Re: Forbid to DROP temp tables of other sessions |