CI CompilerWarnings test fails on 15 in mingw_cross_warning
CI CompilerWarnings test fails on 15 in mingw_cross_warning
От:
Andres Freund <andres@anarazel.de>
Дата:
Hi,
See https://cirrus-ci.com/task/5880116075560960
[18:14:04.821] time make -s -j${BUILD_JOBS} world-bin
[18:15:49.090] pg_locale.c: In function ‘get_collation_actual_version’:
[18:15:49.090] pg_locale.c:1763:42: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=]
[18:15:49.090] 1763 | collversion = psprintf("%d.%d,%d.%d",
[18:15:49.090] | ~^
[18:15:49.090] | |
[18:15:49.090] | int
[18:15:49.090] | %ld
[18:15:49.090] 1764 | (version.dwNLSVersion >> 8) & 0xFFFF,
[18:15:49.090] | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[18:15:49.090] | |
[18:15:49.090] | long unsigned int
I have no idea why we are seeing this error now when we didn't in the past -
there don't seem to have been any relevant changes?
It does reproduce on my debian sid machine, so it's something we ought to fix,
I think?
We did fix it in newer versions:
Author: Peter Eisentraut
Branch: master Release: REL_16_BR [a9bc04b21] 2023-03-24 07:21:40 +0100
Fix incorrect format placeholders
The fields of NLSVERSIONINFOEX are of type DWORD, which is unsigned
long, so the results of the computations being printed are also of
type unsigned long.
Peter, any reason you didn't backpatch that?
Greetings,
Andres Freund
Re: CI CompilerWarnings test fails on 15 in mingw_cross_warning
От:
Peter Eisentraut <peter@eisentraut.org>
Дата:
On 17.11.24 02:59, Andres Freund wrote:
> Hi,
>
> See https://cirrus-ci.com/task/5880116075560960
>
> [18:14:04.821] time make -s -j${BUILD_JOBS} world-bin
> [18:15:49.090] pg_locale.c: In function ‘get_collation_actual_version’:
> [18:15:49.090] pg_locale.c:1763:42: error: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=]
> [18:15:49.090] 1763 | collversion = psprintf("%d.%d,%d.%d",
> [18:15:49.090] | ~^
> [18:15:49.090] | |
> [18:15:49.090] | int
> [18:15:49.090] | %ld
> [18:15:49.090] 1764 | (version.dwNLSVersion >> 8) & 0xFFFF,
> [18:15:49.090] | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> [18:15:49.090] | |
> [18:15:49.090] | long unsigned int
>
> I have no idea why we are seeing this error now when we didn't in the past -
> there don't seem to have been any relevant changes?
>
> It does reproduce on my debian sid machine, so it's something we ought to fix,
> I think?
>
> We did fix it in newer versions:
>
> Author: Peter Eisentraut
> Branch: master Release: REL_16_BR [a9bc04b21] 2023-03-24 07:21:40 +0100
>
> Fix incorrect format placeholders
>
> The fields of NLSVERSIONINFOEX are of type DWORD, which is unsigned
> long, so the results of the computations being printed are also of
> type unsigned long.
>
> Peter, any reason you didn't backpatch that?
The more interesting patch is 495ed0ef2d7, which did
- collversion = psprintf("%d.%d,%d.%d",
+ collversion = psprintf("%ld.%ld,%ld.%ld",
whereas my patch just did
- collversion = psprintf("%ld.%ld,%ld.%ld",
+ collversion = psprintf("%lu.%lu,%lu.%lu",
The former change was part of a larger patch, so it was not a candidate
for backpatching.
As to why it's happening now, the code in question is guarded by
#elif defined(WIN32) && _WIN32_WINNT >= 0x0600
so if it didn't happen before, maybe the _WIN32_WINNT value changed.
Re: CI CompilerWarnings test fails on 15 in mingw_cross_warning
От:
Thomas Munro <thomas.munro@gmail.com>
Дата:
On Thu, Nov 28, 2024 at 6:09 PM Thomas Munro wrote:
> As for why now, I think both fairywren and CI started warning/failing
> about 2 months ago[1][2]
Ohhh... it's because:
commit d700e8d75bc3844d866bf15c8cadbd72d759422d
Author: Andrew Dunstan
Date: Mon Sep 30 11:32:32 2024 -0400
Bump MIN_WINNT for MINGW to clear a build error
That was 15 only. It was in that thread too, I just forgot. Sorry,
it took noticing that fairywren doesn't warn on 14 to trigger the
memory :-)