Re: shadow variables - pg15 edition

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

On Tue, Aug 23, 2022 at 01:38:40PM +1200, David Rowley wrote:
> On Tue, 23 Aug 2022 at 13:17, Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:
> > Attached is a squished version.
>
> I see there's some renaming ones snuck in there. e.g:
> ... in fact, there's lots of renaming, so I'll just stop looking.

Actually, they didn't sneak in - what I sent are the patches which are ready to
be reviewed, excluding the set of "this" and "tmp" and other renames which you
disliked. In the branch (not the squished patch) the first ~15 patches were
mostly for C99 for loops - I presented them this way deliberately, so you could
review and comment on whatever you're able to bite off, or run with whatever
parts you think are ready. I rewrote it now to be more bite sized by
truncating off the 2nd half of the patches.

> Can you just send a patch that only changes the cases where you can
> remove a variable declaration from an outer scope into a single inner
> scope, or multiple inner scope when the variable can be declared
> inside a for() loop?

> would be to move the found_whole_row declaration into multiple inner
> scopes. That's a net increase in code lines, for which I think
> requires more careful thought if we want that or not.

IMO it doesn't make sense to declare multiple integers for something like this
whether they're all ignored. Nor for "save_errno" nor the third, similar case,
for the reason in the commit message.

--
Justin

Attachment Content-Type Size
v2-truncated.txt text/plain 48.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2022-08-23 02:17:59 Considering additional sort specialisation functions for PG16
Previous Message Thomas Munro 2022-08-23 02:14:02 Re: sockaddr_un.sun_len vs. reality