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

2024-03-14 Thread Robert Haas
On Wed, Feb 7, 2024 at 7:55 PM Noah Misch wrote: > > So my suggestion is for people to respond with -1, -0.5, +-0, +0.5, or > > +1 to indicate support against/for the change. > > I'm +1 for the change, for these reasons: > > - Fewer back-patch merge conflicts. The decls section of long functions

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

2024-02-07 Thread Noah Misch
On Mon, Jan 29, 2024 at 04:03:44PM +0100, Jelte Fennema-Nio wrote: > I feel like this is the type of change where there's not much > discussion to be had. And the only way to resolve it is to use some > voting to gauge community opinion. > > So my suggestion is for people to respond with -1,

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

2024-02-03 Thread jian he
On Mon, Jan 29, 2024 at 11:04 PM Jelte Fennema-Nio wrote: > > I feel like this is the type of change where there's not much > discussion to be had. And the only way to resolve it is to use some > voting to gauge community opinion. > > So my suggestion is for people to respond with -1, -0.5, +-0,

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

2024-01-30 Thread Peter Eisentraut
On 29.01.24 16:03, Jelte Fennema-Nio wrote: I feel like this is the type of change where there's not much discussion to be had. And the only way to resolve it is to use some voting to gauge community opinion. So my suggestion is for people to respond with -1, -0.5, +-0, +0.5, or +1 to indicate

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

2024-01-29 Thread Andres Freund
Hi, On January 29, 2024 2:09:23 PM PST, Tom Lane wrote: >Andres Freund writes: >> On 2024-01-29 15:01:06 -0500, Robert Haas wrote: >>> And it still baffles me why we allow everyone to pick their own system for >>> capitalizing identifiers out of a hat, without even insisting on consistency >>>

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

2024-01-29 Thread Tom Lane
Andres Freund writes: > On 2024-01-29 15:01:06 -0500, Robert Haas wrote: >> And it still baffles me why we allow everyone to pick their own system for >> capitalizing identifiers out of a hat, without even insisting on consistency >> from one end of the same identifier to the other. > Yes.

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

2024-01-29 Thread Andres Freund
Hi, On 2024-01-29 15:01:06 -0500, Robert Haas wrote: > And it still baffles me why we allow everyone to pick their own system for > capitalizing identifiers out of a hat, without even insisting on consistency > from one end of the same identifier to the other. Yes. Please. I hate some

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

2024-01-29 Thread Andrew Dunstan
On 2024-01-29 Mo 14:58, Andres Freund wrote: Hi, On 2023-12-27 12:48:40 +0100, Jelte Fennema-Nio wrote: Postgres currently requires all variables to be declared at the top of the function, because it specifies -Wdeclaration-after-statement. One of the reasons that we had this warning was

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

2024-01-29 Thread Robert Haas
On Mon, Jan 29, 2024 at 1:38 PM Heikki Linnakangas wrote: > -0.5 from me, for exactly those reasons Robert said. I wouldn't mind > removing the compiler flag as long as we mostly keep the current style > of declarations at top, with exceptions when it really makes sense. But > in practice it

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

2024-01-29 Thread Andres Freund
Hi, On 2023-12-27 12:48:40 +0100, Jelte Fennema-Nio wrote: > Postgres currently requires all variables to be declared at the top of > the function, because it specifies -Wdeclaration-after-statement. One > of the reasons that we had this warning was because C89 required this > style of

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

2024-01-29 Thread Euler Taveira
On Mon, Jan 29, 2024, at 12:03 PM, Jelte Fennema-Nio wrote: > I feel like this is the type of change where there's not much > discussion to be had. And the only way to resolve it is to use some > voting to gauge community opinion. > > So my suggestion is for people to respond with -1, -0.5, +-0,

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

2024-01-29 Thread Heikki Linnakangas
On 29/01/2024 19:07, Robert Haas wrote: On Mon, Jan 29, 2024 at 10:03 AM Jelte Fennema-Nio wrote: I feel like this is the type of change where there's not much discussion to be had. And the only way to resolve it is to use some voting to gauge community opinion. So my suggestion is for people

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

2024-01-29 Thread Isaac Morland
On Mon, 29 Jan 2024 at 10:42, Mark Dilger wrote: > I don't think anybody is proposing re-working the existing codebase. I > understand this to be only about allowing new code to use the newer style. > Personally, I like, as much as possible, to use initializations to const > variables and avoid

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

2024-01-29 Thread Robert Haas
On Mon, Jan 29, 2024 at 10:03 AM Jelte Fennema-Nio wrote: > I feel like this is the type of change where there's not much > discussion to be had. And the only way to resolve it is to use some > voting to gauge community opinion. > > So my suggestion is for people to respond with -1, -0.5, +-0,

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

2024-01-29 Thread Ranier Vilela
Em seg., 29 de jan. de 2024 às 12:03, Jelte Fennema-Nio escreveu: > I feel like this is the type of change where there's not much > discussion to be had. And the only way to resolve it is to use some > voting to gauge community opinion. > > So my suggestion is for people to respond with -1,

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

2024-01-29 Thread Mark Dilger
> On Jan 29, 2024, at 7:35 AM, Isaac Morland wrote: > > On Mon, 29 Jan 2024 at 10:31, Mark Dilger > 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

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

2024-01-29 Thread Nathan Bossart
On Mon, Jan 29, 2024 at 10:23:38AM -0500, Tom Lane wrote: > Jelte Fennema-Nio writes: >> I feel like this is the type of change where there's not much >> discussion to be had. And the only way to resolve it is to use some >> voting to gauge community opinion. > >> So my suggestion is for people

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

2024-01-29 Thread Isaac Morland
On Mon, 29 Jan 2024 at 10:31, Mark Dilger wrote: > > > > On Jan 29, 2024, at 7:03 AM, Jelte Fennema-Nio > wrote: > > > > So my suggestion is for people to respond with -1, -0.5, +-0, +0.5, or > > +1 to indicate support against/for the change. > > -1 for me. > > -Infinity for refactoring the

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

2024-01-29 Thread Mark Dilger
> On Jan 29, 2024, at 7:03 AM, Jelte Fennema-Nio wrote: > > So my suggestion is for people to respond with -1, -0.5, +-0, +0.5, or > +1 to indicate support against/for the change. -1 for me. -Infinity for refactoring the entire codebase and backpatching. — Mark Dilger EnterpriseDB:

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

2024-01-29 Thread Tom Lane
Jelte Fennema-Nio writes: > I feel like this is the type of change where there's not much > discussion to be had. And the only way to resolve it is to use some > voting to gauge community opinion. > So my suggestion is for people to respond with -1, -0.5, +-0, +0.5, or > +1 to indicate support

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

2024-01-29 Thread Jelte Fennema-Nio
I feel like this is the type of change where there's not much discussion to be had. And the only way to resolve it is to use some voting to gauge community opinion. So my suggestion is for people to respond with -1, -0.5, +-0, +0.5, or +1 to indicate support against/for the change. I'll start:

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

2023-12-27 Thread Jelte Fennema-Nio
On Wed, 27 Dec 2023 at 16:05, Tom Lane wrote: > This has already been debated, and the conclusion was that we would > stick to the existing style for consistency reasons. I looked through the archives quite a bit, but I couldn't find any conclusive debate about the current declaration style.

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

2023-12-27 Thread Tom Lane
Jelte Fennema-Nio writes: > Postgres currently requires all variables to be declared at the top of > the function, because it specifies -Wdeclaration-after-statement. One > of the reasons that we had this warning was because C89 required this > style of declaration. Requiring it everywhere made

Should we remove -Wdeclaration-after-statement?

2023-12-27 Thread Jelte Fennema-Nio
Postgres currently requires all variables to be declared at the top of the function, because it specifies -Wdeclaration-after-statement. One of the reasons that we had this warning was because C89 required this style of declaration. Requiring it everywhere made backporting easier, since some of