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 1qMAm8-001ZTk-S1 for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jul 2023 17:15:44 +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 1qMAm6-008E2e-5k for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Jul 2023 17:15:42 +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 1qMAm5-008E2V-Pq for pgsql-hackers@lists.postgresql.org; Wed, 19 Jul 2023 17:15:41 +0000 Received: from mail-oa1-x2e.google.com ([2001:4860:4864:20::2e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qMAlx-000Tv0-0n for pgsql-hackers@postgresql.org; Wed, 19 Jul 2023 17:15:40 +0000 Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-1b06da65bdbso5430476fac.1 for ; Wed, 19 Jul 2023 10:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neon-tech.20221208.gappssmtp.com; s=20221208; t=1689786932; x=1692378932; h=in-reply-to:references:subject:from:to:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gst/lZk1B8xS5FpezASmRRXRtUDkteftm/j8lCJcVNI=; b=1+P7RsploqHXl//7RvztMiif8HjJn+fkljnZj4npD0bEa5Ym4UKJKj/pIe3BvIaD6x srUOHqdMw4TRyNfu5C/WuHJKyYWr41kh3wVYcLi6V0iLqEkjPn70lRzPtjLGFDEM5FoZ bK3rfvUnNwFOmMJ4ZONbxRVrt6W4QygriaaMu0B+yZh4BrW+9W5UmtdM7EuSdsbrENrx xGwEsA3GdbEm1TsMSSw3I+ZXie+Qzpk47LTJ/Sx8JbpJkqlul6SRXew7y5ETOG3WvYHR jTdqEgqFTDLEfTq8scWdNN62BGUTjV6ujX6U+Uh7EKvvJ662cfVKoD+85GXPVJfj4LY7 WdwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689786932; x=1692378932; h=in-reply-to:references:subject:from:to:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=gst/lZk1B8xS5FpezASmRRXRtUDkteftm/j8lCJcVNI=; b=HW1Jf++y20drwOQxTyMu0zsYqFsDS5rb69jEgfSeJ1M8DpfHbSxJ64CbmbXLHyXEOU vu7bsiJt6terGnsjD+QQ5xFR+7fuYB+xv0a7zVxhmIrC3dMy496aRy7/GiOHyiThZ/xa a1885FtmwJSFVWgebjn0ACufyHgaL/luGjnXr26+Iy8+NTDqSeBsXCb/1u5XwVU7p9Ff qNfQA6RXbx/3eqnAER3/L49RGr1OdxZJOm7X8hEGIRu7KpexcjnKMaZxznvKmEvFyc7T pcs0ACtfZDHC9qgHMEIEzK7KoZtiEtPj13ZLwyi9AIxndbZ5oX98Vd4yOg+VwzPCdjQE nBfw== X-Gm-Message-State: ABy/qLbim9ZZ6MKUAIczRSwb7rZWIi4MAYnJyfj6lmRK0jC75saFLCRc R2poMHSZ+WiyID1OiulmsdfMeJZSM5CQUHPi6gU= X-Google-Smtp-Source: APBJJlFNKCnE4h69d+C+ACfSDrtsNjvw9HUuM8O6ehBiPR5iHzdh1jWBBUro68lPnoAlv5QzHxCYaA== X-Received: by 2002:a05:6870:c224:b0:1b0:3821:f09e with SMTP id z36-20020a056870c22400b001b03821f09emr3228125oae.18.1689786932377; Wed, 19 Jul 2023 10:15:32 -0700 (PDT) Received: from localhost ([2607:fb90:f280:130d:3996:e070:71ee:42fb]) by smtp.gmail.com with ESMTPSA id q7-20020a4aac47000000b005660ed0becesm1894569oon.39.2023.07.19.10.15.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Jul 2023 10:15:31 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=Flowed Date: Wed, 19 Jul 2023 12:15:31 -0500 Message-Id: To: "Peter Eisentraut" , From: "Tristan Partin" Subject: Re: Fix last unitialized memory warning X-Mailer: aerc 0.15.2-105-g00bf476582f7 References: <8f7880cc-3622-1c0a-a126-5b47aafeee51@eisentraut.org> <54989bdd-d6fe-92dc-a7e3-f4f31252b7eb@eisentraut.org> In-Reply-To: <54989bdd-d6fe-92dc-a7e3-f4f31252b7eb@eisentraut.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun Jul 9, 2023 at 2:23 AM CDT, Peter Eisentraut wrote: > On 06.07.23 15:41, Tristan Partin wrote: > > On Thu Jul 6, 2023 at 3:21 AM CDT, Peter Eisentraut wrote: > >> On 05.07.23 23:06, Tristan Partin wrote: > >>> Thanks for following up. My system is Fedora 38. I can confirm this i= s > >>> still happening on master. > >>> > >>> $ gcc --version > >>> gcc (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4) > >>> Copyright (C) 2023 Free Software Foundation, Inc. > >>> This is free software; see the source for copying conditions. There = is NO > >>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PU= RPOSE. > >>> $ meson setup build --buildtype=3Drelease > >> > >> This buildtype turns on -O3 warnings. We have usually opted against > >> chasing warnings in -O3 level because there are often some > >> false-positive uninitialized variable warnings with every new compiler= . > >> > >> Note that we have set the default build type to debugoptimized, for th= at > >> reason. > >=20 > > Good to know, thanks. > >=20 > > Regarding the original patch, do you think it is good to be applied? > > That patch looks reasonable. But I can't actually reproduce the=20 > warning, even with gcc-13. I do get the warning from plpgsql. Can you= =20 > show the warning you are seeing? Here is the full warning that the original patch suppresses. [1360/1876] Compiling C object src/bin/pgbench/pgbench.p/pgbench.c.o In function =E2=80=98coerceToInt=E2=80=99, inlined from =E2=80=98evalStandardFunc=E2=80=99 at ../src/bin/pgbench/p= gbench.c:2607:11: ../src/bin/pgbench/pgbench.c:2032:17: warning: =E2=80=98vargs[0].type=E2=80= =99 may be used uninitialized [-Wmaybe-uninitialized] 2032 | if (pval->type =3D=3D PGBT_INT) | ~~~~^~~~~~ ../src/bin/pgbench/pgbench.c: In function =E2=80=98evalStandardFunc=E2=80= =99: ../src/bin/pgbench/pgbench.c:2240:22: note: =E2=80=98vargs=E2=80=99 declare= d here 2240 | PgBenchValue vargs[MAX_FARGS]; | ^~~~~ In function =E2=80=98coerceToInt=E2=80=99, inlined from =E2=80=98evalStandardFunc=E2=80=99 at ../src/bin/pgbench/p= gbench.c:2607:11: ../src/bin/pgbench/pgbench.c:2034:32: warning: =E2=80=98vargs[0].u.ival=E2= =80=99 may be used uninitialized [-Wmaybe-uninitialized] 2034 | *ival =3D pval->u.ival; | ~~~~~~~^~~~~ ../src/bin/pgbench/pgbench.c: In function =E2=80=98evalStandardFunc=E2=80= =99: ../src/bin/pgbench/pgbench.c:2240:22: note: =E2=80=98vargs=E2=80=99 declare= d here 2240 | PgBenchValue vargs[MAX_FARGS]; | ^~~~~ In function =E2=80=98coerceToInt=E2=80=99, inlined from =E2=80=98evalStandardFunc=E2=80=99 at ../src/bin/pgbench/p= gbench.c:2607:11: ../src/bin/pgbench/pgbench.c:2039:40: warning: =E2=80=98vargs[0].u.dval=E2= =80=99 may be used uninitialized [-Wmaybe-uninitialized] 2039 | double dval =3D rint(pval->u.dval); | ^~~~~~~~~~~~~~~~~~ ../src/bin/pgbench/pgbench.c: In function =E2=80=98evalStandardFunc=E2=80= =99: ../src/bin/pgbench/pgbench.c:2240:22: note: =E2=80=98vargs=E2=80=99 declare= d here 2240 | PgBenchValue vargs[MAX_FARGS]; | ^~~~~ --=20 Tristan Partin Neon (https://neon.tech)