Skip to content

Commit fa92c18

Browse files
committed
Fix MinGW %d vs %lu warnings in back branches.
Commit 352f6f2 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 d700e8d), so the code was suddenly being compiled, with warnings from gcc. The warnings were already fixed in 16+ by commits 495ed0e and a9bc04b 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
1 parent 4112a25 commit fa92c18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/utils/adt/pg_locale.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,7 @@ get_collation_actual_version(char collprovider, const char *collcollate)
17181718
collcollate,
17191719
GetLastError())));
17201720
}
1721-
collversion = psprintf("%d.%d,%d.%d",
1721+
collversion = psprintf("%lu.%lu,%lu.%lu",
17221722
(version.dwNLSVersion >> 8) & 0xFFFF,
17231723
version.dwNLSVersion & 0xFF,
17241724
(version.dwDefinedVersion >> 8) & 0xFFFF,

0 commit comments

Comments
 (0)