Re: elog/ereport noreturn decoration

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: elog/ereport noreturn decoration
Дата
Msg-id 13213.1342304172@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: elog/ereport noreturn decoration  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: elog/ereport noreturn decoration  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> A small sidetrack here.  I've managed to set up the Solaris Studio
> compiler on Linux and tried this out.  It turns out these "statement not
> reached" warnings have nothing to do with knowledge about library
> functions such as abort() or exit() not returning.  The warnings come
> mostly from loops that never end (except by returning from the function)
> and some other more silly cases where the supposed fallback return
> statement is clearly unnecessary.  I think these should be fixed,
> because the code is wrong and could mask real errors if someone ever
> wanted to rearrange those loops or something.

> Patch attached.  I tried this out with old and new versions of gcc,
> clang, and the Solaris compiler, and everyone was happy about.  I didn't
> touch the regex code.  And there's some archeological knowledge about
> Perl in there.

Hm.  I seem to recall that at least some of these lines were themselves
put in to suppress compiler warnings.  So we may just be moving the
warnings from one set of non-mainstream compilers to another set.
Still, we might as well try it and see if there's a net reduction.
(In some places we might need to tweak the code a bit harder than this,
to make it clearer that the unreachable spot is unreachable.)
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: elog/ereport noreturn decoration
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Synchronous Standalone Master Redoux