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 1tJOL0-002hne-6J for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Dec 2024 02:45:02 +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 1tJOKx-009eOG-Gu for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Dec 2024 02:45:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tJOKx-009eO8-7h for pgsql-hackers@lists.postgresql.org; Fri, 06 Dec 2024 02:45:00 +0000 Received: from mail-oo1-xc2f.google.com ([2607:f8b0:4864:20::c2f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tJOKv-001HWp-Fl for pgsql-hackers@lists.postgresql.org; Fri, 06 Dec 2024 02:44:59 +0000 Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-5f1d6ca3b6eso43405eaf.2 for ; Thu, 05 Dec 2024 18:44:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733453097; x=1734057897; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=imVBP609B48nTgqheR2th8GeMpXf0ObkpaQ2fg6IBo4=; b=PX8UhbwDV6+b5/ycGI7/1I+/pBk4DMuSoBX8Fvqn/Z5KQyFejIeHAtK8b/XQtKF5TF DKyf29+0lUar2YROlRstq0PG/WsZ/pisD6K3b/b5hwQbW2DaegMjFJHKALp/nIS8W+Pu HDBnH7P31qoXrAuAibRA46MwO8/d3QMEWp4sJZoa0k+Su7GmsBMsY8sJW3hhZybrryK4 CH8sekcYO0yLe8DVXBjhLsDfo82vJGXZFgjXO1ySbiwN1lRfIyx7rnO4KeE7uK1figpV qzKzJFs5Y4/yk0TxVWjN401CgBU6LM/pL6oS18rcZ4riS5ryIvpjNvpdEv6pEtNPCevG 5sqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733453097; x=1734057897; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=imVBP609B48nTgqheR2th8GeMpXf0ObkpaQ2fg6IBo4=; b=KfK8+o3msN5pIkgXiccMdClzImb9CVNheWYL+dMyTWzyzqwlBlPHLdurzKqutxf65W NaXEmHuBGOGrg0gZRjdZuDKUmb8v9sAvJAU6KeRYdi3D28oOZxNmQKNhMjhqmhYhkGFV hYWZtef5BBZIudLQDd1twdKmoSjY+ifAiaxfDDzjlGFIrLwCk8/0e2ZPfCQzGEmBpYXE 2lufnfGaPmqemqm5nyrrlai4wnkeghb2v3ejhT/iYC3s5GWMeQHZzG7Lse4EsmNKR3LR lpIoNymki9UeKQTmZsYziY5D1FUmeYD/mYP+iRRhJo3vvBcXPdOrYn0WPLpaGbdgNoAC U70g== X-Forwarded-Encrypted: i=1; AJvYcCVrW/m7QKhMHaYTGZXf9g+niIUntwBz87iyY3OfDSMt0rbcdUWM6qwsFcYitqFqFnMwgMzFYb79NNf4RSde@lists.postgresql.org X-Gm-Message-State: AOJu0YzRUHlStd7XMd/DCCUw/KT4iTPUTLKRY3UVu/zaXYoNCmV5lxEs vvRjD+e3hMQmQ6Fkwxx7jlF3nKnyF+32P2H8Hc6ZJUGDOY2urudzjTaLCoNn6f5Layme9zBjve9 8W+3lFMBPI2DQwvvI528V84r51vw= X-Gm-Gg: ASbGncsDQgX8Fq/cFDgcdl+gQ5WjBNmRoQACnqMS65qJ8zEz4j47uoSGPJZRPI7LANI OlWGUp9z3Dp444VdyznY/WNIz9/KtdOBl X-Google-Smtp-Source: AGHT+IGmly3w/M3yil+bfyP7GRyLCJ+nndOA+PZvvMLVzF7Z7bSLPJkvGNl6Nn+aiR+E1ojv8Equ0qdtN7DRxNOJgCU= X-Received: by 2002:a4a:eb19:0:b0:5e3:b1fe:b1a with SMTP id 006d021491bc7-5f28700e98amr252591eaf.2.1733453096665; Thu, 05 Dec 2024 18:44:56 -0800 (PST) MIME-Version: 1.0 References: <760c9dd1-2d80-c223-3f90-609b615f7918@2ndquadrant.com> <127d468dd80c7b1b4c616e111431faf60e091697.camel@postgresql.org> <2530095.1733411471@sss.pgh.pa.us> In-Reply-To: <2530095.1733411471@sss.pgh.pa.us> From: Thomas Munro Date: Fri, 6 Dec 2024 15:44:20 +1300 Message-ID: Subject: Re: MinGW compiler warnings in ecpg tests To: Tom Lane Cc: "Hayato Kuroda (Fujitsu)" , Peter Eisentraut , Michael Meskes , "pgsql-hackers@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Dec 6, 2024 at 4:13=E2=80=AFAM Tom Lane wrote: > 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 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 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. > An alternative could be to add the missing dllimport on Windows; > it's not clear whether other toolchains would care. I've been digging through its headers (working on a fix for the off_t bug report) and noticed in passing that it probably thinks we're re-declaring this function: https://github.com/mingw-w64/mingw-w64/blob/8bcd5fc1a72c0b6da3147bf21a4a494= c81d14fae/mingw-w64-headers/crt/stdlib.h#L221 Seems like a good idea to give that a wide berth :-)