1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

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.
This commit is contained in:
Tom Lane
2007-05-04 02:01:02 +00:00
parent d26559dbf3
commit 79ca7ffeb6
4 changed files with 36 additions and 10 deletions

View File

@ -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();
}