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

From Tom Lane
Subject Re: Should we remove -Wdeclaration-after-statement?
Date
Msg-id 2494006.1703689528@sss.pgh.pa.us
Whole thread Raw
In response to Should we remove -Wdeclaration-after-statement?  (Jelte Fennema-Nio <postgres@jeltef.nl>)
Responses Re: Should we remove -Wdeclaration-after-statement?
List pgsql-hackers
Jelte Fennema-Nio <postgres@jeltef.nl> 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 backporting easier,
> since some of our older supported PG versions needed to compile on
> C89. Now that we have dropped support for PG11 that reason goes away,
> since now all supported Postgres versions require C99. So, I think
> it's worth reconsidering if we want this warning to be enabled or not.

This has already been debated, and the conclusion was that we would
stick to the existing style for consistency reasons.  The fact that
back-portable patches required it was only one of the arguments, and
not the decisive one.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: cannot abort transaction 2737414167, it was already committed
Next
From: Tom Lane
Date:
Subject: Re: pg_upgrade failing for 200+ million Large Objects