pgsql: A few fixups in error handling: mark pg_re_throw() as noreturn

Started by Tom Laneabout 19 years ago3 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Log Message:
-----------
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.

Modified Files:
--------------
pgsql/src/backend/utils/error:
assert.c (r1.33 -> r1.34)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/error/assert.c.diff?r1=1.33&r2=1.34)
elog.c (r1.184 -> r1.185)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/error/elog.c.diff?r1=1.184&r2=1.185)
pgsql/src/include:
postgres.h (r1.79 -> r1.80)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/postgres.h.diff?r1=1.79&r2=1.80)
pgsql/src/include/utils:
elog.h (r1.85 -> r1.86)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/elog.h.diff?r1=1.85&r2=1.86)

#2Magnus Hagander
magnus@hagander.net
In reply to: Tom Lane (#1)
Re: pgsql: A few fixups in error handling: mark pg_re_throw() as noreturn

Do we want to add other compiler specific fixes, such as the MSVC one?
Should be easy enough to do if we want to...

//Magnus

Show quoted text

On Thu, May 03, 2007 at 11:01:02PM -0300, Tom Lane wrote:

Log Message:
-----------
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.

Modified Files:
--------------
pgsql/src/backend/utils/error:
assert.c (r1.33 -> r1.34)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/error/assert.c.diff?r1=1.33&r2=1.34)
elog.c (r1.184 -> r1.185)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/error/elog.c.diff?r1=1.184&r2=1.185)
pgsql/src/include:
postgres.h (r1.79 -> r1.80)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/postgres.h.diff?r1=1.79&r2=1.80)
pgsql/src/include/utils:
elog.h (r1.85 -> r1.86)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/elog.h.diff?r1=1.85&r2=1.86)

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#2)
Re: pgsql: A few fixups in error handling: mark pg_re_throw() as noreturn

Magnus Hagander <magnus@hagander.net> writes:

Do we want to add other compiler specific fixes, such as the MSVC one?

Didn't see much point; the exit() call is useless but shouldn't add much
code bloat. The only reason I bothered to special-case gcc is that so
many of us use it.

regards, tom lane