pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Improve unreachability recognition in elog() macro. 5+ messages / 1 participants [nested] [flat]
* pgsql: Improve unreachability recognition in elog() macro. @ 2016-09-10 21:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2016-09-10 21:54 UTC (permalink / raw) To: pgsql-committers Improve unreachability recognition in elog() macro. Some experimentation with an older version of gcc showed that it is able to determine whether "if (elevel_ >= ERROR)" is compile-time constant if elevel_ is declared "const", but otherwise not so much. We had accounted for that in ereport() but were too miserly with braces to make it so in elog(). I don't know how many currently-interesting compilers have the same quirk, but in case it will save some code space, let's make sure that elog() is on the same footing as ereport() for this purpose. Back-patch to 9.3 where we introduced pg_unreachable() calls into elog/ereport. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/f2717c79eeecaf5997016d52fd81881301dcfc5e Modified Files -------------- src/include/utils/elog.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Improve unreachability recognition in elog() macro. @ 2016-09-10 21:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2016-09-10 21:54 UTC (permalink / raw) To: pgsql-committers Improve unreachability recognition in elog() macro. Some experimentation with an older version of gcc showed that it is able to determine whether "if (elevel_ >= ERROR)" is compile-time constant if elevel_ is declared "const", but otherwise not so much. We had accounted for that in ereport() but were too miserly with braces to make it so in elog(). I don't know how many currently-interesting compilers have the same quirk, but in case it will save some code space, let's make sure that elog() is on the same footing as ereport() for this purpose. Back-patch to 9.3 where we introduced pg_unreachable() calls into elog/ereport. Branch ------ REL9_6_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/fa7b3a88dd5d7f6d18614eefc6cc0662e31bd451 Modified Files -------------- src/include/utils/elog.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Improve unreachability recognition in elog() macro. @ 2016-09-10 21:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2016-09-10 21:54 UTC (permalink / raw) To: pgsql-committers Improve unreachability recognition in elog() macro. Some experimentation with an older version of gcc showed that it is able to determine whether "if (elevel_ >= ERROR)" is compile-time constant if elevel_ is declared "const", but otherwise not so much. We had accounted for that in ereport() but were too miserly with braces to make it so in elog(). I don't know how many currently-interesting compilers have the same quirk, but in case it will save some code space, let's make sure that elog() is on the same footing as ereport() for this purpose. Back-patch to 9.3 where we introduced pg_unreachable() calls into elog/ereport. Branch ------ REL9_5_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/43ef6abcbb6010593a000a0d42303f138b9f5b4c Modified Files -------------- src/include/utils/elog.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Improve unreachability recognition in elog() macro. @ 2016-09-10 21:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2016-09-10 21:54 UTC (permalink / raw) To: pgsql-committers Improve unreachability recognition in elog() macro. Some experimentation with an older version of gcc showed that it is able to determine whether "if (elevel_ >= ERROR)" is compile-time constant if elevel_ is declared "const", but otherwise not so much. We had accounted for that in ereport() but were too miserly with braces to make it so in elog(). I don't know how many currently-interesting compilers have the same quirk, but in case it will save some code space, let's make sure that elog() is on the same footing as ereport() for this purpose. Back-patch to 9.3 where we introduced pg_unreachable() calls into elog/ereport. Branch ------ REL9_4_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/ebd971f74d8a20260bdb281977cfbd5404bfbb76 Modified Files -------------- src/include/utils/elog.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Improve unreachability recognition in elog() macro. @ 2016-09-10 21:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2016-09-10 21:54 UTC (permalink / raw) To: pgsql-committers Improve unreachability recognition in elog() macro. Some experimentation with an older version of gcc showed that it is able to determine whether "if (elevel_ >= ERROR)" is compile-time constant if elevel_ is declared "const", but otherwise not so much. We had accounted for that in ereport() but were too miserly with braces to make it so in elog(). I don't know how many currently-interesting compilers have the same quirk, but in case it will save some code space, let's make sure that elog() is on the same footing as ereport() for this purpose. Back-patch to 9.3 where we introduced pg_unreachable() calls into elog/ereport. Branch ------ REL9_3_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/0db3c5552a16c0e73e0c24a36a3bacc77820bf02 Modified Files -------------- src/include/utils/elog.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2016-09-10 21:54 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2016-09-10 21:54 pgsql: Improve unreachability recognition in elog() macro. Tom Lane <tgl@sss.pgh.pa.us> 2016-09-10 21:54 pgsql: Improve unreachability recognition in elog() macro. Tom Lane <tgl@sss.pgh.pa.us> 2016-09-10 21:54 pgsql: Improve unreachability recognition in elog() macro. Tom Lane <tgl@sss.pgh.pa.us> 2016-09-10 21:54 pgsql: Improve unreachability recognition in elog() macro. Tom Lane <tgl@sss.pgh.pa.us> 2016-09-10 21:54 pgsql: Improve unreachability recognition in elog() macro. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox