Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcsOB-0001z5-RK for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Mar 2023 18:31:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pcsO9-0000wp-P1 for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Mar 2023 18:31:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcsO9-0000wf-FP for pgsql-hackers@lists.postgresql.org; Thu, 16 Mar 2023 18:31:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcsO6-0002uJ-0B for pgsql-hackers@lists.postgresql.org; Thu, 16 Mar 2023 18:31:44 +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 32GIVbh73959492; Thu, 16 Mar 2023 14:31:38 -0400 From: Tom Lane To: Andres Freund cc: pgsql-hackers@lists.postgresql.org Subject: Re: More weird compiler warnings In-reply-to: <20230316171846.2yurkzkibrkn566t@awork3.anarazel.de> References: <144536.1648326206@sss.pgh.pa.us> <20220326205549.mwwlx7cejdght7bf@alap3.anarazel.de> <20230316171846.2yurkzkibrkn566t@awork3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Thu, 16 Mar 2023 10:18:46 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3959490.1678991497.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 16 Mar 2023 14:31:37 -0400 Message-ID: <3959491.1678991497@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2022-03-26 13:55:49 -0700, Andres Freund wrote: >> On 2022-03-26 16:23:26 -0400, Tom Lane wrote: >>> but I'm wondering if we could silence the warning by changing the loop= condition to >>> while (--nb >=3D 0) >>> which seems like it might be marginally more readable anyway. >> Yes, that looks like it silences it. I modified the small reproducer I= had in >> that bug (https://godbolt.org/z/ejK9h6von) and the warning vanishes. > The recent discussion about warnings reminded me of this. Given the gcc = bug > hasn't been fixed, I think we should make that change. I'd vote for > backpatching it as well - what do you think? +1, can't hurt anything AFAICS. regards, tom lane