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 1qH9iB-0003fc-G6 for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Jul 2023 21:06:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qH9iA-0002G2-7i for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Jul 2023 21:06:54 +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 1qH9i9-0002Fs-V1 for pgsql-hackers@lists.postgresql.org; Wed, 05 Jul 2023 21:06:53 +0000 Received: from mail-oo1-xc2f.google.com ([2607:f8b0:4864:20::c2f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qH9i5-002PUw-08 for pgsql-hackers@postgresql.org; Wed, 05 Jul 2023 21:06:53 +0000 Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-5634808e16eso5025762eaf.2 for ; Wed, 05 Jul 2023 14:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neon-tech.20221208.gappssmtp.com; s=20221208; t=1688591207; x=1691183207; h=in-reply-to:references:from:to:subject:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=cTyaD01fuSQN48LZTG6UPMHNBHPb+Fckty+jbQzx6NQ=; b=cuyMwg8icJcECeb0zHM1ZxsiviWq24Y9RFnJ4vzw3aheiyjjj6xLYlaPyBcPtHgfZ4 8opGbGhFr00Fihnkq5dBSrF+lstRmwcxPoCjzN07Liq/GdUmGyobp2lxCFvRMJoUKjqY 59Si/cS0mkhtUIT90vDdwC+vuAzStUmHViGjrF7aPqPWKlr0/gXHxA00gLtenAQgMIR6 Jez9HmcRNgr8eIrNOs2RRNs8rDWIuiODLjVDOAlwl1tsJZjHpyYEkIuZI+LJqMob2/gA IX3/xqueenFmXcG8MOfFtN2Ob48xQgfMK6Z4IcJt922UK5xyb3D2YAM4Lp7HJIn3hZVw zghQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688591207; x=1691183207; h=in-reply-to:references:from:to:subject:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=cTyaD01fuSQN48LZTG6UPMHNBHPb+Fckty+jbQzx6NQ=; b=aLolj7i2xJ5scX5OFmTnfZhC1VHhNT/4RReX4tUn0nMo3/sxPjJgVqghsolC3ZFP5V eesCiwvlk5xNis4qMCr3TCBdDNjkVzJMPqrEVTwIIKauJxvdZZ/nU6dsEscL9CDIieQ8 lMD1UY/AdbmcR7k0F+TQUEP/SZ3bzi9toiw2LEeRfKSszG91hpscq24GTz0a/+Wso3CY 1Eu4lLLu6XTtmAAwOCRuv4i3VX3MN33UhnQ8nSBXmUWbc+8FDw5ZdtJG7LkoKTRYBCiW GS5OW7e7Kf4Y6ebeJ2kuCMLvivx0VvVzQFGh/IbcAKl3VeLMmLW4PIor7p6DzMwpPXra qAng== X-Gm-Message-State: ABy/qLaSWhSn+E+P6E41riwQveGMufIZ9L9AJZo6ga0FlKrR5CmY7fP4 Ukim2Afx/AKdoOcDQxaFSFT1ZN0+4gRiH8ZXnqnGDw== X-Google-Smtp-Source: APBJJlHVq3k0K6z4ip2QtWAWl8Fx1KXe937wlJN0bSGPSG4VO41YZnMO3cjY6CkKDa58Hd4PqpLMxw== X-Received: by 2002:a05:6808:13cf:b0:3a3:9463:ccbf with SMTP id d15-20020a05680813cf00b003a39463ccbfmr16689619oiw.15.1688591207393; Wed, 05 Jul 2023 14:06:47 -0700 (PDT) Received: from localhost ([2607:fb90:f280:130d:3996:e070:71ee:42fb]) by smtp.gmail.com with ESMTPSA id u17-20020a056808151100b003a3d273aef8sm23739oiw.6.2023.07.05.14.06.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Jul 2023 14:06:47 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 05 Jul 2023 16:06:46 -0500 Message-Id: Subject: Re: Fix last unitialized memory warning To: "Peter Eisentraut" , From: "Tristan Partin" X-Mailer: aerc 0.15.2-76-g69094e332779 References: <8f7880cc-3622-1c0a-a126-5b47aafeee51@eisentraut.org> In-Reply-To: <8f7880cc-3622-1c0a-a126-5b47aafeee51@eisentraut.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon Jul 3, 2023 at 1:19 AM CDT, Peter Eisentraut wrote: > On 07.06.23 16:31, Tristan Partin wrote: > > This patch is really not necessary from a functional point of view. It > > is only necessary if we want to silence a compiler warning. > >=20 > > Tested on `gcc (GCC) 13.1.1 20230511 (Red Hat 13.1.1-2)`. > >=20 > > After silencing this warning, all I am left with (given my build > > configuration) is: > >=20 > > [1667/2280] Compiling C object src/pl/plpgsql/src/plpgsql.so.p/pl_exec.= c.o > > In file included from ../src/include/access/htup_details.h:22, > > from ../src/pl/plpgsql/src/pl_exec.c:21: > > In function =E2=80=98assign_simple_var=E2=80=99, > > inlined from =E2=80=98exec_set_found=E2=80=99 at ../src/pl/plpgsql= /src/pl_exec.c:8349:2: > > ../src/include/varatt.h:230:36: warning: array subscript 0 is outside a= rray bounds of =E2=80=98char[0]=E2=80=99 [-Warray-bounds=3D] > > 230 | (((varattrib_1b_e *) (PTR))->va_tag) > > | ^ > > ../src/include/varatt.h:94:12: note: in definition of macro =E2=80=98VA= RTAG_IS_EXPANDED=E2=80=99 > > 94 | (((tag) & ~1) =3D=3D VARTAG_EXPANDED_RO) > > | ^~~ > > ../src/include/varatt.h:284:57: note: in expansion of macro =E2=80=98VA= RTAG_1B_E=E2=80=99 > > 284 | #define VARTAG_EXTERNAL(PTR) VARTAG= _1B_E(PTR) > > | ^~~~~~= ~~~~~ > > ../src/include/varatt.h:301:57: note: in expansion of macro =E2=80=98VA= RTAG_EXTERNAL=E2=80=99 > > 301 | (VARATT_IS_EXTERNAL(PTR) && !VARTAG_IS_EXPANDED(VARTAG= _EXTERNAL(PTR))) > > | ^~~~~~= ~~~~~~~~~ > > ../src/pl/plpgsql/src/pl_exec.c:8537:17: note: in expansion of macro = =E2=80=98VARATT_IS_EXTERNAL_NON_EXPANDED=E2=80=99 > > 8537 | VARATT_IS_EXTERNAL_NON_EXPANDED(DatumGetPointe= r(newvalue))) > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > >=20 > > From my perspective, this warning definitely seems like a false > > positive, but I don't know the code well-enough to say that for certain= . > > I cannot reproduce this warning with gcc-13. Are you using any=20 > non-standard optimization options. Could you give your full configure=20 > and build commands and the OS? Thanks for following up. My system is Fedora 38. I can confirm this is 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 PURPOSE. $ meson setup build --buildtype=3Drelease $ ninja -C build --=20 Tristan Partin Neon (https://neon.tech)