pgsql: Enable -Wimplicit-fallthrough option for clang

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Enable -Wimplicit-fallthrough option for clang
Date: 2026-02-23 07:00:58
Message-ID: E1vuPwA-000lzX-03@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Enable -Wimplicit-fallthrough option for clang

On clang, -Wimplicit-fallthrough requires annotations with attributes,
but on gcc, -Wimplicit-fallthrough is the same as
-Wimplicit-fallthrough=3, which allows annotations with comments. In
order to enforce consistent annotations with attributes on both
compilers, we test first for -Wimplicit-fallthrough=5, which will
succeed on gcc, and if that is not found we test for
-Wimplicit-fallthrough.

Reviewed-by: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
Discussion: https://www.postgresql.org/message-id/flat/76a8efcd-925a-4eaf-bdd1-d972cd1a32ff%40eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0284e07599a53d27d744042c10aec3e2e674d5b5

Modified Files
--------------
configure | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
configure.ac | 14 ++++++++
meson.build | 19 ++++++++++-
3 files changed, 135 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2026-02-23 09:39:55 pgsql: meson: Refactor libpq targets variables
Previous Message Peter Eisentraut 2026-02-23 07:00:57 pgsql: Fix additional fallthrough warnings from clang