]> granicus.if.org Git - postgresql/commit
Teach compiler that ereport(>=ERROR) does not return
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 21 Aug 2012 04:03:32 +0000 (00:03 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 21 Aug 2012 04:03:32 +0000 (00:03 -0400)
commit71450d7fd6c7cf7b3e38ac56e363bff6a681973c
tree172ff1ebc32be5c6c275da415625e43f39252ae4
parentffdd5a0ee37c5ac38038aeff98328727e986d2da
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.
src/include/utils/elog.h