From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Don't rely on pointer arithmetic with Pointer type
Date: Wed, 03 Dec 2025 08:54:41 +0000
Message-ID: <E1vQidE-002YxO-2j@gemulon.postgresql.org> (raw)
Don't rely on pointer arithmetic with Pointer type
The comment for the Pointer type says 'XXX Pointer arithmetic is done
with this, so it can't be void * under "true" ANSI compilers.'. This
fixes that. Change from Pointer to use char * explicitly where
pointer arithmetic is needed. This makes the meaning of the code
clearer locally and removes a dependency on the actual definition of
the Pointer type. (The definition of the Pointer type is not changed
in this commit.)
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://www.postgresql.org/message-id/4154950a-47ae-4223-bd01-1235cc50e933%40eisentraut.org
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/756a43689324b473ee07549a6eb7a53a203df5ad
Modified Files
--------------
contrib/bloom/bloom.h | 2 +-
contrib/bloom/blutils.c | 4 ++--
contrib/bloom/blvacuum.c | 2 +-
src/backend/access/gin/gindatapage.c | 18 ++++++++---------
src/backend/access/gin/ginxlog.c | 20 +++++++++----------
src/backend/access/rmgrdesc/genericdesc.c | 4 ++--
src/backend/utils/adt/multirangetypes.c | 32 +++++++++++++++----------------
src/backend/utils/adt/rangetypes.c | 16 ++++++++--------
8 files changed, 49 insertions(+), 49 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: Don't rely on pointer arithmetic with Pointer type
In-Reply-To: <E1vQidE-002YxO-2j@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