From: | Thomas Munro <thomas(dot)munro(at)gmail(dot)com> |
---|---|
To: | "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com> |
Cc: | 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> |
Subject: | Re: MinGW compiler warnings in ecpg tests |
Date: | 2024-12-05 12:15:52 |
Message-ID: | CA+hUKGKvkPh7XENM8QaF=B5-V84A6bThMLsyv1JM5XMcg9FeKw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, Nov 10, 2023 at 9:00 PM Hayato Kuroda (Fujitsu)
<kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
> Sorry for reviving the old thread. While trying to build postgres on msys2 by meson,
> I faced the same warning. The OS is Windows 10.
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.
That leaves only three more annoying warnings:
../pgsql/src/backend/postmaster/postmaster.c:857:31: warning:
'__p__environ' redeclared without dllimport attribute: previous
dllimport ignored [-Wattributes]
857 | extern char **environ;
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.
Attachment | Content-Type | Size |
---|---|---|
0001-Fix-printf-format-string-warning-on-MinGW.patch | application/x-patch | 54.0 KB |
0002-Fix-warnings-about-declaration-of-environ-on-MinGW.patch | application/x-patch | 1.9 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Kirill Reshke | 2024-12-05 12:22:34 | Re: Pass ParseState as down to utility functions. |
Previous Message | Amit Langote | 2024-12-05 12:03:09 | Re: generic plans and "initial" pruning |