Thread: PRI?64 vs Visual Studio (2022)

PRI?64 vs Visual Studio (2022)

From
Kyotaro Horiguchi
Date:
Hello,

If you're already aware of this and have taken it into account, please
feel free to ignore this.

As described in the recent commit a0ed19e0a9e, many %ll? format
specifiers are being replaced with %<PRI?64>.

I hadn’t paid much attention to this before, but I happened to check
how this behaves on Windows, and it seems that with VS2022, PRId64
expands to "%lld". As a result, I suspect the gettext message catalog
won't match these messages correctly.

I haven't been able to build with -Dnls=enabled myself, but I did
check the strings embedded in a binary compiled with VS2022, and they
indeed use %lld.

Just wanted to share this in case it’s helpful.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center

Re: PRI?64 vs Visual Studio (2022)

From
Peter Eisentraut
Date:
On 31.03.25 08:28, Kyotaro Horiguchi wrote:
> If you're already aware of this and have taken it into account, please
> feel free to ignore this.
> 
> As described in the recent commit a0ed19e0a9e, many %ll? format
> specifiers are being replaced with %<PRI?64>.
> 
> I hadn’t paid much attention to this before, but I happened to check
> how this behaves on Windows, and it seems that with VS2022, PRId64
> expands to "%lld". As a result, I suspect the gettext message catalog
> won't match these messages correctly.

I think this is working correctly.  Gettext has a built-in mechanism to 
translate the %<PRI...> back to the appropriate  %lld or %ld.  See also 
<https://www.gnu.org/software/gettext/manual/html_node/c_002dformat.html>.