diff options
author | Thomas Munro <tmunro@postgresql.org> | 2024-11-29 10:58:01 +1300 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2024-11-29 11:09:29 +1300 |
commit | fce6fd5da580542e026ac023352cafcb97854fec (patch) | |
tree | 55d37152b4dfe12bac6544e5fe8bc46e703167fa /src/backend/utils/adt/pg_locale.c | |
parent | aa663d37c068cb6bffb363f74ff6c566ecd40543 (diff) |
Fix MinGW %d vs %lu warnings in back branches.
Commit 352f6f2d used %d instead of %lu to format DWORD (unsigned long)
with psprintf(). The _WIN32_WINNT value recently changed for MinGW in
REL_15_STABLE (commit d700e8d7), so the code was suddenly being
compiled, with warnings from gcc.
The warnings were already fixed in 16+ by commits 495ed0ef and a9bc04b2
after the _WIN32_WINNT value was increase there. 14 and 13 didn't warn
because they still use a lower value for MinGW, and supported versions
of Visual Studio should compile the code in all live branches but don't
check our format string.
The change doesn't affect the result: sizeof(int) == sizeof(long) on
this platform, and the values are computed with expressions that cannot
exceed INT_MAX so were never interpreted as negative.
Back-patch the formatting change from those commits into 13-15. This
should turn CI's 15 branch green again and stop fairywren from warning
about that on 15.
Reported-by: Andres Freund <andres@anarazel.de>
Reported-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/t2vjrcb3bloxf5qqvxjst6r7lvrefqyecxgt2koy5ho5b5glr2%40yuupmm6whgob
Diffstat (limited to 'src/backend/utils/adt/pg_locale.c')
-rw-r--r-- | src/backend/utils/adt/pg_locale.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c index 94acf82118a..3c4fde6113b 100644 --- a/src/backend/utils/adt/pg_locale.c +++ b/src/backend/utils/adt/pg_locale.c @@ -1759,7 +1759,7 @@ get_collation_actual_version(char collprovider, const char *collcollate) collcollate, GetLastError()))); } - collversion = psprintf("%d.%d,%d.%d", + collversion = psprintf("%lu.%lu,%lu.%lu", (version.dwNLSVersion >> 8) & 0xFFFF, version.dwNLSVersion & 0xFF, (version.dwDefinedVersion >> 8) & 0xFFFF, |