Re: Making C function declaration parameter names consistent with corresponding definition names - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Making C function declaration parameter names consistent with corresponding definition names
Date
Msg-id CAH2-Wzk2etJjj8rhKn9MG9hQ2B+5tWuZneCkGyusqraGQaaeBA@mail.gmail.com
Whole thread Raw
In response to Re: Making C function declaration parameter names consistent with corresponding definition names  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Making C function declaration parameter names consistent with corresponding definition names
List pgsql-hackers
On Fri, Sep 16, 2022 at 4:49 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Agreed; I see no need to tolerate any inconsistency.

The check that I used to write the patches doesn't treat unnamed
parameters in a function declaration as an inconsistency, even when
"strict" is used. Another nearby check *could* be used to catch
unnamed parameters [1] if that was deemed useful, though. How do you
feel about unnamed parameters?

Many of the function declarations from reorderbuffer.h will be
affected if we decide that we don't want to allow unnamed parameters
-- it's quite noticeable there. I myself lean towards not allowing
unnamed parameters. (Though perhaps I should reserve judgement until
after I've measured just how prevalent unnamed parameters are.)

> Yeah.  I'd be inclined to handle it about like cpluspluscheck:
> provide a script that people can run from time to time, but
> don't insist that it's a commit-blocker.

My thoughts exactly.

[1] https://releases.llvm.org/14.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability-named-parameter.html
-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Making C function declaration parameter names consistent with corresponding definition names
Next
From: "Bagga, Rishu"
Date:
Subject: Re: SLRUs in the main buffer pool, redux