public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Eisentraut <[email protected]>
To: pgsql-hackers <[email protected]>
Subject: Re: Use standard C23 and C++ attributes if available
Date: Wed, 1 Apr 2026 08:34:39 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

On 19.02.26 09:54, Peter Eisentraut wrote:
> This is related to the C++ compatibility work in [0].
> 
> This patch proposes to use the standard C23 and C++ attributes 
> [[nodiscard]], [[noreturn]], and [[maybe_unused]], if available.
> 
> The immediate practical impact is that for pg_noreturn, we can drop the 
> GCC-specific and MSVC-specific fallbacks, because the C11 and the C++ 
> implementation will now cover all required cases.
> 
> For the other two attributes, this makes them available in not-GCC- 
> compatible compilers that support C23 as well as in C++.  This set is 
> theoretical at the moment, but it might become more practical if either 
> MSVC gets some C23 support or we improve the support for C++ extensions 
> with MSVC (see also [0]).
> 
> 
> [0]: https://www.postgresql.org/message-id/df78eaac- 
> c2eb-4344-852e-0965c75c5ad6%40eisentraut.org

This has been committed.  Note that the C++ extension support with MSVC 
exists now, so this patch has some utility for that.





view thread (2+ messages)

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]
  Subject: Re: Use standard C23 and C++ attributes if available
  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