pgsql: Teach compiler that ereport(>=ERROR) does not return

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Teach compiler that ereport(>=ERROR) does not return
Date: 2012-08-21 04:05:57
Message-ID: E1T3fj3-0002Ag-8e@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Teach compiler that ereport(>=ERROR) does not return

When elevel >= ERROR, we add an abort() call to the ereport() macro to
give the compiler a hint that the ereport() expansion will not return,
but the abort() isn't actually reached because the longjmp happens in
errfinish().

Because the effect of ereport() varies with the elevel, we cannot use
standard compiler attributes such as noreturn for this.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/71450d7fd6c7cf7b3e38ac56e363bff6a681973c

Modified Files
--------------
src/include/utils/elog.h | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2012-08-21 15:14:41 pgsql: Add a note to the MVCC chapter that some things aren't transacti
Previous Message Peter Eisentraut 2012-08-21 03:47:52 pgsql: Remove external PID file on postmaster exit