Re: Making C function declaration parameter names consistent with corresponding definition names

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Making C function declaration parameter names consistent with corresponding definition names
Date: 2022-09-17 19:58:41
Message-ID: CAH2-Wz=VD9FgBfT8cQNez3F-R1jfSDN9LKy21GhJqQQqPJmvfA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Sep 17, 2022 at 11:36 AM Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
> I'd be surprised if this created more than 3 minutes of extra work for
> you when updating the timezone code.

Attached revision adds a new, third patch. This fixes all the warnings
from clang-tidy's "readability-named-parameter" check. The extent of
the code churn seems acceptable to me.

BTW. there are just a couple of remaining unfixed
"readability-inconsistent-declaration-parameter-name" warnings --
legitimately tricky cases. These are related to simplehash.h client
code, where we use the C preprocessor to simulate C++ templates
(Bjarne strikes again). It would be possible to suppress the warnings
by making the client code use matching generic function-style
parameter names, but that doesn't seem like an improvement.

If we're going to adapt a project policy around parameter names, then
we'll need a workaround -- probably just by suppressing a handful of
tricky warnings. For now my focus is cleaning things up on HEAD.

--
Peter Geoghegan

Attachment Content-Type Size
v2-0002-Harmonize-parameter-names-in-pg_dump-pg_dumpall.patch application/octet-stream 28.1 KB
v2-0003-Consistently-use-named-parameters.patch application/octet-stream 38.4 KB
v2-0001-Harmonize-parameter-names.patch application/octet-stream 182.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2022-09-17 21:42:10 Re: [PoC] Improve dead tuple storage for lazy vacuum
Previous Message Tom Lane 2022-09-17 19:00:01 Re: missing indexes in indexlist with partitioned tables