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

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Enable -Wstrict-prototypes and -Wold-style-definition by default
Date: 2026-03-27 12:15:29
Message-ID: 7bf60ab1-2b5d-4a77-93ce-815072a0a014@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
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.)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-03-27 12:17:15 Re: Define DatumGetInt8 function.
Previous Message Nazir Bilal Yavuz 2026-03-27 12:02:03 Re: Beautify read stream "per buffer data" APIs