From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: configure: Apply -Werror=vla to C++ as well as C
Date: Mon, 30 Mar 2026 18:55:39 +0000
Message-ID: <E1w7Hly-002BtZ-0n@gemulon.postgresql.org> (raw)
configure: Apply -Werror=vla to C++ as well as C
The comment part of d9dd406fe281 mentioned that -Wvla is not applicable
for C++. That is not fully correct: it is true that VLAs are not part of the
C++ standard, and g++ with -pedantic will also warn about them as a non-standard
extension. However, -Wvla itself works fine in C++ and will catch VLA
usage just as in C.
Fix configure.ac to apply -Werror=vla to C++ as well. There is no need to
fix meson.build as it already includes it in common_warning_flags.
Author: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Suggested-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/7bf60ab1-2b5d-4a77-93ce-815072a0a014%40eisentraut.org
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/488ab592d9ea1b4c7d6e43389c34c4bbbcb8f0d4
Modified Files
--------------
configure | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
configure.ac | 4 ++--
2 files changed, 54 insertions(+), 4 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: configure: Apply -Werror=vla to C++ as well as C
In-Reply-To: <E1w7Hly-002BtZ-0n@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox