pgsql: Fix -Wcast-qual warnings in regex module

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix -Wcast-qual warnings in regex module
Date: 2026-11-20 10:20:37
Message-ID: E1xULjQ-00000000V9r-0B8k@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix -Wcast-qual warnings in regex module

- Replace some casts with unconstify() where appropriate.

- Make pg_regex_t.re_fns pointer to const, because the "functions" it
points to is also const.

- Define VS() to a no-op. The default definition of casting
to (void *) might cast away a qualifier. This construct is only
needed for supporting ancient C, so we don't need it.

Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/70b86618-4038-4b19-8847-1a400d99d477%40eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0ddda120e08215c43ffaabbc939ead70b2afe3e7

Modified Files
--------------
src/backend/regex/regexec.c | 6 +++---
src/backend/regex/regfree.c | 2 +-
src/include/regex/regcustom.h | 1 +
src/include/regex/regex.h | 2 +-
src/include/regex/regguts.h | 2 +-
5 files changed, 7 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2026-11-20 10:22:35 pgsql: pg_upgrade: Remove unnecessary checks on target cluster's versio
Previous Message Peter Eisentraut 2026-11-20 09:46:20 pgsql: Fix accidentally casting away const