Don't rely on pointer arithmetic with Pointer type
Peter Eisentraut <peter@eisentraut.org>
Author:
Peter Eisentraut <peter@eisentraut.org>
Date: 2025-12-03T08:54:15Z
Releases:
19 (unreleased)
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
Files
| Path | Change | +/− |
|---|---|---|
| contrib/bloom/bloom.h | modified | +1 −1 |
| contrib/bloom/blutils.c | modified | +2 −2 |
| contrib/bloom/blvacuum.c | modified | +1 −1 |
| src/backend/access/gin/gindatapage.c | modified | +9 −9 |
| src/backend/access/gin/ginxlog.c | modified | +10 −10 |
| src/backend/access/rmgrdesc/genericdesc.c | modified | +2 −2 |
| src/backend/utils/adt/multirangetypes.c | modified | +16 −16 |
| src/backend/utils/adt/rangetypes.c | modified | +8 −8 |
Discussion
- get rid of Pointer type, mostly 26 messages · 2025-11-24 → 2026-02-09