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 1nmzDt-0008IM-9k for pgsql-hackers@arkaria.postgresql.org; Fri, 06 May 2022 14:46:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nmzDs-0000vG-4Y for pgsql-hackers@arkaria.postgresql.org; Fri, 06 May 2022 14:46:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmzDr-0000td-RP for pgsql-hackers@lists.postgresql.org; Fri, 06 May 2022 14:46:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmzDp-0002Sh-EH for pgsql-hackers@lists.postgresql.org; Fri, 06 May 2022 14:46:22 +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 246EkKhv2891034; Fri, 6 May 2022 10:46:20 -0400 From: Tom Lane To: Erik Rijkers cc: pgsql-hackers@lists.postgresql.org Subject: Re: gcc 12.1.0 warning In-reply-to: References: Comments: In-reply-to Erik Rijkers message dated "Fri, 06 May 2022 16:34:41 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2891032.1651848380.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 06 May 2022 10:46:20 -0400 Message-ID: <2891033.1651848380@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Erik Rijkers writes: > Not sure if these compiler-mutterings are worth reporting but I guess = > we're trying to get a silent compile. > System: Debian 4.9.303-1 (2022-03-07) x86_64 GNU/Linux > Compiling with gcc 12.1.0 causes the below 'warning' and 'note'. > Compiling with --enable-cassert --enable-debug is silent, no warnings) > In function =E2=80=98guc_var_compare=E2=80=99, > inlined from =E2=80=98bsearch=E2=80=99 at = > /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:33:23, > inlined from =E2=80=98find_option=E2=80=99 at guc.c:5649:35: > guc.c:5736:38: warning: array subscript =E2=80=98const struct config_gen= eric[0]=E2=80=99 = > is partly outside array bounds of =E2=80=98const char[8]=E2=80=99 [-Warr= ay-bounds] > 5736 | return guc_name_compare(confa->name, confb->name); > | ~~~~~^~~~~~ I'd call that a compiler bug. regards, tom lane