clang-tidy complaints

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: pgsql-committers <pgsql-committers(at)lists(dot)postgresql(dot)org>
Subject: clang-tidy complaints
Date: 2025-04-12 16:25:01
Message-ID: CAH2-WzmxPQAF_ZhwrUo3rzVk3yYj_4mqbgiQXAGGO5nFYV3D8Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

I just pushed my annual commit that makes function parameter names
consistent between function declarations and their corresponding
definitions, to cover the Postgres 18 cycle. The details there were
all straightforward. But there are 2 remaining complaints from
clang-tidy that seem worth fixing, that don't quite fall under any
established policy in this area.

The first such complaint concerns a new mcxt.c function parameter that
shadows a global variable in the same file -- attached patch fixes
that by renaming the function parameter. Technically, this is a
distinct type of complaint to the clang-tidy complaints that I
ordinarily fix this time of year, though it's of the same general
nature.

The second such complaint is a standard "function parameter name is
inconsistent" complaint, though it's one that affects vendored code in
src/include/snowball/libstemmer/header.h. I attach a fix for that,
too. In the past we have tended to treat cases with vendored code just
like non-vendored Postgres code, but there's always a question about
whether it's worth diverging from upstream. That needs to be decided
on a case-by-case basis, and I don't know enough to know if I should
proceed here.

I have not attached a fix for a similar vendored code issue that
appears in timingsafe_bcmp.c, since that involved a declaration
provided by my system's openSSL being inconsistent with our own
vendored definition. A fix for that seemed unnecessary.

--
Peter Geoghegan

Attachment Content-Type Size
v1-0002-Make-libstemmer-param-name-consistent.patch application/octet-stream 1.2 KB
v1-0001-Stop-shadowing-global-variable-with-parameter-nam.patch application/octet-stream 4.3 KB

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2025-04-12 16:28:14 pgsql: Fix GIN's shimTriConsistentFn to not corrupt its input.
Previous Message Peter Geoghegan 2025-04-12 16:08:28 pgsql: Harmonize function parameter names for Postgres 18.