pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix -Wcast-qual warnings in regex module
Date: Fri, 20 Nov 2026 10:20:37 +0000
Message-ID: <E1xULjQ-00000000V9r-0B8k@gemulon.postgresql.org> (raw)

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.evan.chao@gmail.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(-)



Message-ID: <E1xULjQ-00000000V9r-0B8k@gemulon.postgresql.org>
Permalink:  ../E1xULjQ-00000000V9r-0B8k@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xULjQ-00000000V9r-0B8k@gemulon.postgresql.org

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org
  Subject: Re: pgsql: Fix -Wcast-qual warnings in regex module
  In-Reply-To: <E1xULjQ-00000000V9r-0B8k@gemulon.postgresql.org>
  References: <E1xULjQ-00000000V9r-0B8k@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