Re: Enable -Wstrict-prototypes and -Wold-style-definition by default

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Nazir Bilal Yavuz <byavuz81@gmail.com>, Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers@lists.postgresql.org
Date: 2026-03-18T19:29:00Z
Lists: pgsql-hackers
Bertrand Drouvot <bertranddrouvot.pg@gmail.com> writes:
> On Wed, Mar 18, 2026 at 01:03:03PM -0400, Tom Lane wrote:
>> We could plausibly fix this either by
>> 
>> (1) renaming ecpg_init_sqlca's parameter to something else;
>> 
>> (2) ensuring that POSTGRES_ECPG_INTERNAL is defined.  I'd be inclined
>> to make ecpglib_extern.h do that rather than expecting headerscheck
>> to know about it.
>> 
>> Neither of these options are beautiful, but perhaps #1 is slightly
>> less ugly.  Any preferences?

> I'd vote for #1 too, done in the attached.

Agreed and pushed.

			regards, tom lane



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add warning option -Wold-style-declaration

  2. configure: Apply -Werror=vla to C++ as well as C

  3. Enable warning like -Wstrict-prototypes on MSVC as well

  4. Remove compiler warning option -Wendif-labels

  5. Disable warnings in system headers in MSVC

  6. Fix -Wstrict-prototypes warning in ecpg_init_sqlca() declaration.