public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Eisentraut <[email protected]>
To: [email protected]
Subject: pgsql: Swap order of extern/static and pg_nodiscard
Date: Fri, 14 Mar 2025 06:32:11 +0000
Message-ID: <[email protected]> (raw)

Swap order of extern/static and pg_nodiscard

When pg_nodiscard was first added, the C standard draft had it as a
function specifier, and so the code comment about placement was
written with that in mind.  The final C23 standard has it as an
attribute and the placement rules are a bit different for that.
Specifically, it needs to be before extern or static.  (Or at least
both current clang and gcc require that.)  So just swap these.  (To be
clear: The current implementation with gcc attributes doesn't care.
This change is just for maximum forward compatibility for non-gcc
compilers.)  This also keeps the order consistent with the previously
introduced pg_noreturn.  Also update the code comment to reflect the
mentioned developments since its introduction.

Reviewed-by: Dagfinn Ilmari MannsÃ¥ker <[email protected]>
Reviewed-by: Andres Freund <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/pxr5b3z7jmkpenssra5zroxi7qzzp6eswuggokw64axmdixpnk@zbwxuq...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/05cbd6cb22d235d2e52ac309266a5fc50053dc16

Modified Files
--------------
src/include/c.h               |  6 ++--
src/include/common/base64.h   |  4 +--
src/include/nodes/pg_list.h   | 68 +++++++++++++++++++++----------------------
src/include/storage/buffile.h |  2 +-
src/include/utils/guc.h       |  2 +-
src/include/utils/palloc.h    |  8 ++---
6 files changed, 45 insertions(+), 45 deletions(-)



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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Swap order of extern/static and pg_nodiscard
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox