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 1uaeb4-00869I-Fv for pgsql-hackers@arkaria.postgresql.org; Sat, 12 Jul 2025 18:05:14 +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 1uaeb2-00ABtn-HQ for pgsql-hackers@arkaria.postgresql.org; Sat, 12 Jul 2025 18:05:13 +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 1uaeb2-00ABte-7m for pgsql-hackers@lists.postgresql.org; Sat, 12 Jul 2025 18:05:12 +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 1uaeb1-006xLj-0C for pgsql-hackers@postgresql.org; Sat, 12 Jul 2025 18:05:11 +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 56CI4r7N085366; Sat, 12 Jul 2025 14:04:53 -0400 From: Tom Lane To: Andres Freund cc: Dmitry Mityugov , pgsql-hackers@postgresql.org Subject: Re: patch: Use pg_assume in jsonb_util.c to fix GCC 15 warnings In-reply-to: References: <0c623e8a204187b87b4736792398eaf1@postgrespro.ru> <82868.1752342174@sss.pgh.pa.us> Comments: In-reply-to Andres Freund message dated "Sat, 12 Jul 2025 13:55:32 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <85364.1752343493.1@sss.pgh.pa.us> Date: Sat, 12 Jul 2025 14:04:53 -0400 Message-ID: <85365.1752343493@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2025-07-12 13:42:54 -0400, Tom Lane wrote: >> I don't care for this patch: replacing an Assert with pg_assume just >> seems like a very bad idea. > That shouldn't be a problem - pg_assume() is defined to be an Assert() in > USE_ASSERT_CHECKING builds. Ah, my bad. But there's still the question of exactly what reasoning the compiler is using to arrive at the conclusion that it need not warn given these assertions, and whether we want to rely on that reasoning not changing. I'd prefer to simplify matters. regards, tom lane