pgsql: Fix casting away of volatile qualifier

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix casting away of volatile qualifier
Date: 2026-10-19 07:06:57
Message-ID: E1xIhST-00000002EFd-1nEH@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix casting away of volatile qualifier

Fix some issues involving volatile that would be triggered by
-Wcast-qual.

For PMSignalState, move the volatile qualifiers to the PMSignalData
fields that need it rather than making the whole structure have it.

For the MemSet() calls, do the initialization honestly with a loop
instead.

Note that the MemSet() calls would be normal "discards qualifier"
warnings if memset() (or another function with a prototype, not a
macro) were used.

Reviewed-by: Rui Zhao <zhaorui126(at)gmail(dot)com>
Reviewed-by: Andres Freund <andres(at)anarazel(dot)de> (older version)
Discussion: https://www.postgresql.org/message-id/c76b72dd-5736-453a-b698-6968d42e4768%40eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/22ff4fc5a21bce3ccf0376e0e91fde8fd2f28655

Modified Files
--------------
src/backend/postmaster/launch_backend.c | 2 +-
src/backend/storage/ipc/pmsignal.c | 8 ++++----
src/backend/storage/ipc/procsignal.c | 6 ++++--
src/backend/utils/activity/backend_progress.c | 3 ++-
src/include/storage/pmsignal.h | 2 +-
5 files changed, 12 insertions(+), 9 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2026-10-19 08:03:31 pgsql: Recompute allocChunkLimit when reusing an AllocSet context
Previous Message David Rowley 2026-10-19 06:44:53 pgsql: Recompute allocChunkLimit when reusing an AllocSet context