Re: Should we remove -Wdeclaration-after-statement? - Mailing list pgsql-hackers

From Noah Misch
Subject Re: Should we remove -Wdeclaration-after-statement?
Date
Msg-id 20240208005541.bf@rfd.leadboat.com
Whole thread Raw
In response to Re: Should we remove -Wdeclaration-after-statement?  (Jelte Fennema-Nio <postgres@jeltef.nl>)
Responses Re: Should we remove -Wdeclaration-after-statement?
List pgsql-hackers
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, -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 is a
  classic conflict point.
- A mid-func decl demonstrates that its var is unused in the first half of the
  func.
- We write Perl in the mixed decls style, without problems.

For me personally, the "inconsistency" concern is negligible.  We allowed "for
(int i = 0", and that inconsistency has been invisible to me.



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: glibc qsort() vulnerability
Next
From: Yugo NAGATA
Date:
Subject: Re: Rename setup_cancel_handler in pg_dump