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 1ucG6n-00AsE1-C2 for pgsql-committers@arkaria.postgresql.org; Thu, 17 Jul 2025 04:20:37 +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 1ucG6l-00GFUa-BW for pgsql-committers@arkaria.postgresql.org; Thu, 17 Jul 2025 04:20:35 +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 1ucG6l-00GFTc-3v for pgsql-committers@lists.postgresql.org; Thu, 17 Jul 2025 04:20:35 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ucG6j-007hEu-31 for pgsql-committers@lists.postgresql.org; Thu, 17 Jul 2025 04:20:34 +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 56H4KUG91337098; Thu, 17 Jul 2025 00:20:30 -0400 From: Tom Lane To: David Rowley cc: Peter Eisentraut , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p In-reply-to: References: <6c00a8b2-0c40-44f0-b603-f6ae28b7694a@eisentraut.org> <1244428.1752677780@sss.pgh.pa.us> <1330026.1752722396@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Thu, 17 Jul 2025 16:09:18 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1337096.1752726030.1@sss.pgh.pa.us> Date: Thu, 17 Jul 2025 00:20:30 -0400 Message-ID: <1337097.1752726030@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > On Thu, 17 Jul 2025 at 15:19, Tom Lane wrote: >> Hmph. I doubt we are ready to require C11 everywhere, but maybe >> we could require it in MSVC builds? Which MSVC versions would >> that eliminate? > Going by [1] it's Visual Studio 2019, which as of 8fd9bb1d9 is now our > minimum supported VS version. Hmm, so apparently no cost ... also, if I'm getting this right, the only downside of compiling with an older compiler would be seeing a lot of "possibly-uninitialized" warnings. > I hacked up a quick patch (attached) which compiles without any > warnings. Tested on VS2012 with meson setup -Dc_std=c11. Personally I'd think about providing a definition of __builtin_constant_p rather than changing elog.h; but we'd end up at the same place. > Unsure what other repercussions there are of compiling with C11 and > have not looked into what it would take to adjust the meson build > scripts to default to that for MSVC builds. In theory there should be no repercussions, because we already support compiling with C11: C99 is a minimum not a maximum. But I've not checked the meson scripts either. regards, tom lane