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

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Making C function declaration parameter names consistent with corresponding definition names
Дата
Msg-id CAH2-Wzk2etJjj8rhKn9MG9hQ2B+5tWuZneCkGyusqraGQaaeBA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Making C function declaration parameter names consistent with corresponding definition names  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Making C function declaration parameter names consistent with corresponding definition names  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Making C function declaration parameter names consistent with corresponding definition names
Следующее
От: "Bagga, Rishu"
Дата:
Сообщение: Re: SLRUs in the main buffer pool, redux