From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Revert "Replace pg_restrict by standard restrict"
Date: Wed, 14 Jan 2026 14:35:32 +0000
Message-ID: <E1vg1y7-000RYz-30@gemulon.postgresql.org> (raw)
Revert "Replace pg_restrict by standard restrict"
This reverts commit f0f2c0c1aef95757c4e7f144d5577e2b0d814279.
The original problem that led to the use of pg_restrict was that MSVC
couldn't handle plain restrict, and defining it to something else
would conflict with its __declspec(restrict) that is used in system
header files. In C11 mode, this is no longer a problem, as MSVC
handles plain restrict. This led to the commit to replace pg_restrict
with restrict. But this did not take C++ into account. Standard C++
does not have restrict, so we defined it as something else (for
example, MSVC supports __restrict). But this then again conflicts
with __declspec(restrict) in system header files. So we have to
revert this attempt. The comments are updated to clarify that the
reason for this is now C++ only.
Reported-by: Jelte Fennema-Nio <postgres@jeltef.nl>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://www.postgresql.org/message-id/CAGECzQRoD7chJP1-dneSrhxUJv%2BBRcigoGOO4UwGzaShLot2Yw%40mail.g...
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/fa16e7fd84886643f480c36614fa11d45fc6d26f
Modified Files
--------------
configure | 18 ++++++++++++++----
configure.ac | 16 ++++++++++++----
meson.build | 13 +++++++------
src/bin/pg_verifybackup/pg_verifybackup.c | 4 ++--
src/bin/pg_verifybackup/pg_verifybackup.h | 4 ++--
src/common/logging.c | 4 ++--
src/common/string.c | 2 +-
src/include/c.h | 6 ------
src/include/common/logging.h | 4 ++--
src/include/common/string.h | 2 +-
src/include/libpq/pqformat.h | 12 ++++++------
src/include/pg_config.h.in | 4 ++++
12 files changed, 53 insertions(+), 36 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: Revert "Replace pg_restrict by standard restrict"
In-Reply-To: <E1vg1y7-000RYz-30@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