Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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(-)

pgsql-committers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group