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

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2026-03-27T12:15:29Z
Lists: pgsql-hackers
On 27.03.26 11:07, Bertrand Drouvot wrote:
> That looks ok but I wonder if we should also add '-Werror=vla' to it (
> and remove it from common_warning_flags) to be in sync with what configure.ac
> is doing:
> 
> "
>    PGAC_PROG_CC_CFLAGS_OPT([-Werror=vla])
>    # -Wvla is not applicable for C++
> "

Hmm.  This comment is not actually fully correct.  With g++, you can 
write a VLA and it will work, and also -Wvla will warn about it.  So we 
should actually add that option to C++ as well.  (It is true that VLAs 
are not in standard C++, and g++ with -pedantic will also warn about it.)




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.