diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-05-04 02:01:02 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-05-04 02:01:02 +0000 |
commit | 79ca7ffeb6a43c1f2af80ead6a2dffd120594cf9 (patch) | |
tree | 7e2fbab1423be74544c0bfaafd1d496541512191 /src/backend/utils/error/elog.c | |
parent | d26559dbf356736923b26704ce76ca820ff3a2b0 (diff) |
A few fixups in error handling: mark pg_re_throw() as noreturn for gcc,
and for other compilers, insert a dummy exit() call so that they understand
PG_RE_THROW() doesn't return. Insert fflush(stderr) in ExceptionalCondition,
per recent buildfarm evidence that that might not happen automatically on some
platforms. And const-ify ExceptionalCondition's declaration while at it.
Diffstat (limited to 'src/backend/utils/error/elog.c')
-rw-r--r-- | src/backend/utils/error/elog.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c index d74442ee54b..93e7663da3a 100644 --- a/src/backend/utils/error/elog.c +++ b/src/backend/utils/error/elog.c @@ -42,7 +42,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.184 2007/05/02 15:32:41 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.185 2007/05/04 02:01:02 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1151,6 +1151,16 @@ pg_re_throw(void) errfinish(0); } + + /* We mustn't return... */ + ExceptionalCondition("pg_re_throw tried to return", "FailedAssertion", + __FILE__, __LINE__); + + /* + * Since ExceptionalCondition isn't declared noreturn because of + * TrapMacro(), we need this to keep gcc from complaining. + */ + abort(); } |