Re: Should we remove -Wdeclaration-after-statement?

Поиск
Список
Период
Сортировка
От Mark Dilger
Тема Re: Should we remove -Wdeclaration-after-statement?
Дата
Msg-id 6A453B53-E741-47D8-818A-D7BD6C039AB7@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Should we remove -Wdeclaration-after-statement?  (Isaac Morland <isaac.morland@gmail.com>)
Ответы Re: Should we remove -Wdeclaration-after-statement?  (Isaac Morland <isaac.morland@gmail.com>)
Список pgsql-hackers

> On Jan 29, 2024, at 7:35 AM, Isaac Morland <isaac.morland@gmail.com> wrote:
>
> On Mon, 29 Jan 2024 at 10:31, Mark Dilger <mark.dilger@enterprisedb.com> wrote:
>
> -Infinity for refactoring the entire codebase and backpatching.
>
> I don't think anybody is proposing re-working the existing codebase. I understand this to be only about allowing new
codeto use the newer style. Personally, I like, as much as possible, to use initializations to const variables and
avoidassignment operators, so I much prefer to declare at first (and usually only) assignment. 

I was responding to Jelte's paragraph upthread:

> On Dec 27, 2023, at 9:59 AM, Jelte Fennema-Nio <postgres@jeltef.nl> wrote:
>
> But if the only reason not to remove the
> warning is that then there would be two styles of declaration in the
> codebase, then I'm happy to create another refactoring script that
> moves declarations down to their first usage. (Which could then be run
> on all backbranches to make sure there is no backpatching pain)

I find that kind of gratuitous code churn highly unpleasant.

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company






В списке pgsql-hackers по дате отправления:

Предыдущее
От: Nathan Bossart
Дата:
Сообщение: Re: Should we remove -Wdeclaration-after-statement?
Следующее
От: Ronan Dunklau
Дата:
Сообщение: Re: scalability bottlenecks with (many) partitions (and more)