Re: elog/ereport noreturn decoration
Peter Eisentraut <peter_e@gmx.net>
From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2012-08-19T02:37:27Z
Lists: pgsql-hackers
On Fri, 2012-06-29 at 23:35 +0300, Peter Eisentraut wrote: > My proposal with ereport would be to do this: > > diff --git i/src/include/utils/elog.h w/src/include/utils/elog.h > --- i/src/include/utils/elog.h > +++ w/src/include/utils/elog.h > @@ -104,7 +104,8 @@ > */ > #define ereport_domain(elevel, domain, rest) \ > (errstart(elevel, __FILE__, __LINE__, PG_FUNCNAME_MACRO, domain) ? \ > - (errfinish rest) : (void) 0) > + (errfinish rest) : (void) 0), \ > + (elevel >= ERROR ? abort() : (void) 0) > > There are no portability problems with that. While the discussion on what to do about elog() was ongoing, I think there should be no problems with this ereport() change, so I intend to go ahead with it.