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 1tsETw-00GrlG-21 for pgsql-committers@arkaria.postgresql.org; Wed, 12 Mar 2025 05:18:16 +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 1tsETu-00EEHR-Hs for pgsql-committers@arkaria.postgresql.org; Wed, 12 Mar 2025 05:18:14 +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 1tsETu-00EEHI-Am for pgsql-committers@lists.postgresql.org; Wed, 12 Mar 2025 05:18:14 +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.96) (envelope-from ) id 1tsETq-002NEE-20 for pgsql-committers@lists.postgresql.org; Wed, 12 Mar 2025 05:18:13 +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 52C5I9vs1896565; Wed, 12 Mar 2025 01:18:09 -0400 From: Tom Lane To: Masahiko Sawada cc: David Rowley , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: pg_logicalinspect: Fix possible crash when passing a directory p In-reply-to: References: Comments: In-reply-to Masahiko Sawada message dated "Tue, 11 Mar 2025 21:56:14 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1896563.1741756689.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 12 Mar 2025 01:18:09 -0400 Message-ID: <1896564.1741756689@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Masahiko Sawada writes: > On Tue, Mar 11, 2025 at 7:08 PM David Rowley wrote: >> This introduces a new compiler warning for compilers that don't know >> the ereport(ERROR) does not return. > Thank you for the report. Can we generate the warning using some gcc's > warning flags? I'd like to add a check to my personal pre-commit test. I don't know of an easy way. I experimented with doing this: diff --git a/src/include/c.h b/src/include/c.h index a14c6315162..467b1f58ae8 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -315,7 +315,7 @@ #elif defined(_MSC_VER) && !defined(USE_ASSERT_CHECKING) #define pg_unreachable() __assume(0) #else -#define pg_unreachable() abort() +#define pg_unreachable() ((void) 0) #endif /* which seems like it ought to be enough to provoke such warnings (in assert-enabled builds). I got upwards of sixty build warnings this way, but the place David mentions was *not* among them. So I'm confused. regards, tom lane