Re: PRI?64 vs Visual Studio (2022)
| От | Thomas Munro |
|---|---|
| Тема | Re: PRI?64 vs Visual Studio (2022) |
| Дата | |
| Msg-id | CA+hUKGJnmzTqiODmTjf-23yZ=E3HXqFTtKoyp3TF-MpB93hTMQ@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: PRI?64 vs Visual Studio (2022) (Peter Eisentraut <peter@eisentraut.org>) |
| Ответы |
Re: PRI?64 vs Visual Studio (2022)
Re: PRI?64 vs Visual Studio (2022) Re: PRI?64 vs Visual Studio (2022) |
| Список | pgsql-hackers |
On Wed, Apr 2, 2025 at 2:04 AM Peter Eisentraut <peter@eisentraut.org> wrote: > On 31.03.25 08:28, Kyotaro Horiguchi wrote: > > 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>. Interesting report though. Commit 962da900 assumed that our in-tree printf implementation still needed to understand that %I64 stuff in case it came to us from system headers, but it looks like it disappeared with MSVCRT: 1. I checked with CI (VS 2019). puts(PRId64) prints out "lld". 2. MinGW's inttypes.h[1] only uses "I64" et al if you build against MSVCRT. So I think we should delete that stuff. Attached. I worried that GNU gettext() might still know about %I64 somewhere, but it just expands the macros to whatever inttypes.h defines[2]. Good. We don't even test -Dnls on the Windows CI task, so the fact that it passes there doesn't mean much (if our tests would even pick up <PRI*64> expansion failure, not sure). We should probably do something about that and/or its absence from the build farm. We're effectively counting on the EDB packaging team or end users to tell us if we break localisation on this platform. I was also curious to know if the nearby floating point formatting kludge added by commit f1885386 was still needed today. CI passes without it, and the standard is pretty clear: "The exponent always contains at least two digits, and only as many more digits as necessary to represent the exponent". I didn't look too closely at the fine print, but that text was already present in C89 so I guess MSVCRT just failed to conform on that point. [1] https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/crt/inttypes.h [2] https://github.com/autotools-mirror/gettext/blob/637b208fbe13f1c306f19d4f31c21fec7e9986d2/gettext-runtime/intl/loadmsgcat.c#L473
Вложения
В списке pgsql-hackers по дате отправления: