Re: 64 bit numbers vs format strings

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: 64 bit numbers vs format strings
Date: 2025-03-17 11:50:40
Message-ID: CA+hUKGLm5iM41n4yHFYy38Wsy1DcCju+3DuXPQK6dBpZwZ=9pA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 17, 2025 at 11:52 PM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> tmunro(at)s11-sparc:~/gettext-hacking$ gcc test.c
> tmunro(at)s11-sparc:~/gettext-hacking$ ./a.out
> la réponse est 42

And just to be paranoid, I checked a few more things: the .mo
definitely contains the literal "PRId64" (rearranged as
"^(at)PRId64^@the answer is %") and it's definitely using gettext() from
libc and not somehow automatically finding a GNU library in some
search path. (And woop, this cfarm Sun box has received the new
preadv()/pwritev() in its libc, that they added for PostgreSQL.)

And since I remembered that I had a NetBSD vagrant VM handy from
investigating Champion's libpq troubles the other day:

[vagrant(at)netbsd9 gettext-hacking]$ cc test.c -lintl
[vagrant(at)netbsd9 gettext-hacking]$ ldd a.out
a.out:
-lintl.1 => /usr/lib/libintl.so.1
-lc.12 => /usr/lib/libc.so.12
[vagrant(at)netbsd9 gettext-hacking]$ ./a.out
la réponse est 42

Not that I had much doubt but I checked that the library is indeed the
NetBSD code and not somehow GNU code, based on clearly identifiable
strings.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2025-03-17 11:59:12 Re: Snapshot related assert failure on skink
Previous Message Junwang Zhao 2025-03-17 11:42:38 Re: general purpose array_sort