From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix misuse of "volatile" in xml.c
Date: Mon, 09 Mar 2026 22:06:23 +0000
Message-ID: <E1vzik3-003DYd-2y@gemulon.postgresql.org> (raw)
Fix misuse of "volatile" in xml.c
What should be used is not "volatile foo *ptr" but "foo *volatile ptr",
The incorrect (former) style means that what the pointer variable points
to is volatile. The correct (latter) style means that the pointer
variable itself needs to be treated as volatile. The latter style is
required to ensure a consistent treatment of these variables after a
longjmp with the TRY/CATCH blocks.
Some casts can be removed thanks to this change.
Issue introduced by 2e947217474c, so no backpatch is required. A
similar set of issues has been fixed in 93001888d85c for contrib/xml2/.
Author: ChangAo Chen <cca5507@qq.com>
Discussion: https://postgr.es/m/tencent_5BE8DAD985EE140ED62EA728C8D4E1311F0A@qq.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/6307b096e2599edfe238816118b3f365a73fd12a
Modified Files
--------------
src/backend/utils/adt/xml.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 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: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix misuse of "volatile" in xml.c
In-Reply-To: <E1vzik3-003DYd-2y@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