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 1v29pG-000s0l-7C for pgsql-bugs@arkaria.postgresql.org; Fri, 26 Sep 2025 14:53:34 +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 1v29pE-002YxD-4I for pgsql-bugs@arkaria.postgresql.org; Fri, 26 Sep 2025 14:53:32 +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 1v29pD-002Yx3-SP for pgsql-bugs@lists.postgresql.org; Fri, 26 Sep 2025 14:53:32 +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 1v29pC-000Ex7-19 for pgsql-bugs@lists.postgresql.org; Fri, 26 Sep 2025 14:53:32 +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 58QErQtg4059821; Fri, 26 Sep 2025 10:53:26 -0400 From: Tom Lane To: dcb314@hotmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19066: postgresql-18.0/src/backend/optimizer/geqo/geqo_ox2.c:86: Array index check in wrong place ? In-reply-to: <19066-53bfa81d53f11b75@postgresql.org> References: <19066-53bfa81d53f11b75@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Fri, 26 Sep 2025 09:51:09 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4059819.1758898406.1@sss.pgh.pa.us> Date: Fri, 26 Sep 2025 10:53:26 -0400 Message-ID: <4059820.1758898406@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > Static analyser cppcheck says: > postgresql-18.0/src/backend/optimizer/geqo/geqo_ox2.c:86:22: style: Array > index 'j' is used before limits check. [arrayIndexThenCheck] Did your static analyzer not notice that this dead code is not even compiled? I don't have a lot of faith in analyzers that ignore #ifdefs. (It's fair to ask why we haven't removed this code altogether ... laziness I guess, or waiting for something better than GEQO to come along. But expending effort on fixing it is definitely not in the cards.) regards, tom lane