| From: | Andres Freund <andres(at)anarazel(dot)de> |
|---|---|
| To: | Thomas Munro <thomas(dot)munro(at)gmail(dot)com> |
| Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Michael Meskes <meskes(at)postgresql(dot)org>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com> |
| Subject: | Re: MinGW compiler warnings in ecpg tests |
| Date: | 2025-10-30 21:39:24 |
| Message-ID: | o5yadhhmyjo53svzwvaocww6zkrp63i4f32cw3treuh46pxtza@hyqio5b2tkt6 |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
On 2024-12-06 15:44:20 +1300, Thomas Munro wrote:
> On Fri, Dec 6, 2024 at 4:13 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Thomas Munro <thomas(dot)munro(at)gmail(dot)com> writes:
> > > Yeah. This warning is visible on CI, and on fairywren since its MSYS2
> > > upgrade a couple of months ago. Old MinGW didn't like %lld (I think
> > > perhaps the printf from msvcrt.dll from 1996 didn't like it and MinGW
> > > knew that), but new MinGW doesn't like %I64d (that's interesting, but
> > > not relevant here because %lld is clearly the correct format string,
> > > and it works). We should just revert that change. Here's a patch.
> >
> > +1
>
> Thanks for looking. Pushed, and that fixed that on fairywren.
>
> > > Those were there before the upgrade. POSIX says that environ should
> > > not be declared by a header, but Windows apparently declares it, or at
> > > least its cousin _environ, in <stdlib.h> which we include in c.h. I
> > > have no idea why Visual Studio doesn't warn, or why the documentation
> > > only tells you about _environ and not environ, or where the macro (?)
> > > comes from that renames it, but it passes CI and is
> > > warning-free on both toolchains if you just hide the offending
> > > declarations.
> >
> > Isn't this likely to break things for every other Windows toolchain?
> > I think the concept might be OK, but we need a tighter #if condition.
>
> Cool, I'll do that for MinGW only then.
I was looking at merging [1], however the backbranches < 18 fail in
CompilerWarnings due to this error [2], after upgrading to trixie. Seems like
we ought to backpatch 7bc9a8bdd2d. Haven't checked yet whether 1319997d is
also required for a clean build.
Greetings,
Andres Freund
[1] https://postgr.es/m/CAN55FZ1_B1usTskAv%2BAYt1bA7abVd9YH6XrUUSbr-2Z0d5Wd8w%40mail.gmail.com
[2] https://cirrus-ci.com/task/6526575971139584
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jon Jenkins | 2025-10-30 21:40:14 | Potential bug introduced in PG17 with query parallelization - plan flip |
| Previous Message | Peter Geoghegan | 2025-10-30 21:34:29 | Fully documenting the design of nbtree row comparison scan keys |