shadow variables - pg15 edition

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>, Peter Smith <smithpb2250(at)gmail(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>
Subject: shadow variables - pg15 edition
Date: 2022-08-17 14:54:35
Message-ID: 20220817145434.GC26426@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

There's been no progress on this in the past discussions.

https://www.postgresql.org/message-id/flat/877k1psmpf.fsf%40mailbox.samurai.com
https://www.postgresql.org/message-id/flat/CAApHDvpqBR7u9yzW4yggjG%3DQfN%3DFZsc8Wo2ckokpQtif-%2BiQ2A%40mail.gmail.com#2d900bfe18fce17f97ec1f00800c8e27
https://www.postgresql.org/message-id/flat/MN2PR18MB2927F7B5F690065E1194B258E35D0%40MN2PR18MB2927.namprd18.prod.outlook.com

But an unfortunate consequence of not fixing the historic issues is that it
precludes the possibility that anyone could be expected to notice if they
introduce more instances of the same problem (as in the first half of these
patches). Then the hole which has already been dug becomes deeper, further
increasing the burden of fixing the historic issues before being able to use
-Wshadow.

The first half of the patches fix shadow variables newly-introduced in v15
(including one of my own patches), the rest are fixing the lowest hanging fruit
of the "short list" from COPT=-Wshadow=compatible-local

I can't see that any of these are bugs, but it seems like a good goal to move
towards allowing use of the -Wshadow* options to help avoid future errors, as
well as cleanliness and readability (rather than allowing it to get harder to
use -Wshadow).

--
Justin

Attachment Content-Type Size
0001-avoid-shadow-vars-pg_dump.c-i_oid.patch text/x-diff 875 bytes
0002-avoid-shadow-vars-pg_dump.c-tbinfo.patch text/x-diff 1.7 KB
0003-avoid-shadow-vars-pg_dump.c-owning_tab.patch text/x-diff 1.0 KB
0004-avoid-shadow-vars-tablesync.c-first.patch text/x-diff 1.1 KB
0005-avoid-shadow-vars-tablesync.c-slot.patch text/x-diff 1.0 KB
0006-avoid-shadow-vars-basebackup_target.c-ttype.patch text/x-diff 1.0 KB
0007-avoid-shadow-vars-parse_jsontable.c-jtc.patch text/x-diff 1.1 KB
0008-avoid-shadow-vars-res.patch text/x-diff 1.1 KB
0009-avoid-shadow-vars-clauses.c-querytree_list.patch text/x-diff 911 bytes
0010-avoid-shadow-vars-tablecmds.c-constraintOid.patch text/x-diff 919 bytes
0011-avoid-shadow-vars-tablecmds.c-copyTuple.patch text/x-diff 1002 bytes
0012-avoid-shadow-vars-copyfrom.c-attnum.patch text/x-diff 1.3 KB
0013-avoid-shadow-vars-nodeAgg-transno.patch text/x-diff 1.2 KB
0014-avoid-shadow-vars-trigger.c-partitionId.patch text/x-diff 1.1 KB
0015-avoid-shadow-vars-execPartition.c-found_whole_row.patch text/x-diff 1.2 KB
0016-avoid-shadow-vars-brin-keyno.patch text/x-diff 1.3 KB
0017-avoid-shadow-vars-bufmgr.c-j.patch text/x-diff 1.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-08-17 14:57:27 Re: XLogBeginRead's header comment lies
Previous Message Drouvot, Bertrand 2022-08-17 14:48:42 Re: SYSTEM_USER reserved word implementation