Re: pg_attribute_noreturn(), MSVC, C11

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: Andres Freund <andres@anarazel.de>, pgsql-hackers@postgresql.org
Cc: Thomas Munro <thomas.munro@gmail.com>
Date: 2024-12-14T17:18:35Z
Lists: pgsql-hackers
On 13.12.24 20:54, Andres Freund wrote:
> Another wrinkle: While __attribute__((noreturn)) works for function pointers
> (or function pointer typedefs) _Noreturn doesn't. Gah.  We only use it that
> way in two places, but still :(

Yeah, I wrote an experimental patch for noreturn support some years ago, 
and that was also my result back then.  (I assume you have a current 
patch, otherwise I can dig out that one.)  I had also written down that 
there were some problems with Perl and Tcl headers, FWIW.  Did you have 
any problems with those?

I think we can take a small loss here and move with the standard. 
Unless you can think of a way to define 
pg_noreturn_but_for_function_pointers in a systematic way.




Commits

  1. Use standard C23 and C++ attributes if available

  2. Swap order of extern/static and pg_nodiscard

  3. pg_noreturn to replace pg_attribute_noreturn()