Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJDXd-001Zcx-OH for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Dec 2024 15:13:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tJDXb-006tjj-8x for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Dec 2024 15:13:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJDXa-006tif-VI for pgsql-hackers@lists.postgresql.org; Thu, 05 Dec 2024 15:13:20 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJDXZ-001CVD-33; Thu, 05 Dec 2024 15:13:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4B5FBBaw2530096; Thu, 5 Dec 2024 10:11:11 -0500 From: Tom Lane To: Thomas Munro cc: "Hayato Kuroda (Fujitsu)" , Peter Eisentraut , Michael Meskes , "pgsql-hackers@lists.postgresql.org" Subject: Re: MinGW compiler warnings in ecpg tests In-reply-to: References: <760c9dd1-2d80-c223-3f90-609b615f7918@2ndquadrant.com> <127d468dd80c7b1b4c616e111431faf60e091697.camel@postgresql.org> Comments: In-reply-to Thomas Munro message dated "Fri, 06 Dec 2024 01:15:52 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2530094.1733411471.1@sss.pgh.pa.us> Date: Thu, 05 Dec 2024 10:11:11 -0500 Message-ID: <2530095.1733411471@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thomas Munro 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 > 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 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. An alternative could be to add the missing dllimport on Windows; it's not clear whether other toolchains would care. regards, tom lane