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

From: Noah Misch <noah(at)leadboat(dot)com>
To: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, "ranier(dot)vf(at)gmail(dot)com" <ranier(dot)vf(at)gmail(dot)com>, chap(at)anastigmatix(dot)net
Subject: Re: Should we remove -Wdeclaration-after-statement?
Date: 2024-02-08 00:55:41
Message-ID: 20240208005541.bf@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo NAGATA 2024-02-08 01:07:49 Re: Rename setup_cancel_handler in pg_dump
Previous Message Andres Freund 2024-02-08 00:42:07 Re: glibc qsort() vulnerability