pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Replace pg_restrict by standard restrict
Date: Wed, 29 Oct 2025 07:00:30 +0000
Message-ID: <E1vE0AY-0042gY-1F@gemulon.postgresql.org> (raw)

Replace pg_restrict by standard restrict

MSVC in C11 mode supports the standard restrict qualifier, so we don't
need the workaround naming pg_restrict anymore.

Even though restrict is in C99 and should be supported by all
supported compilers, we keep the configure test and the hardcoded
redirection to __restrict, because that will also work in C++ in all
supported compilers.  (restrict is not part of the C++ standard.)

For backward compatibility for extensions, we keep a #define of
pg_restrict around, but our own code doesn't use it anymore.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/0e3d8644-c01d-4374-86ea-9f0a987981f0%40eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f0f2c0c1aef95757c4e7f144d5577e2b0d814279

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, 36 insertions(+), 53 deletions(-)



Message-ID: <E1vE0AY-0042gY-1F@gemulon.postgresql.org>
Permalink:  ../E1vE0AY-0042gY-1F@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vE0AY-0042gY-1F@gemulon.postgresql.org

 · 

reply

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: Replace pg_restrict by standard restrict
  In-Reply-To: <E1vE0AY-0042gY-1F@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