Re: elog/ereport noreturn decoration - Mailing list pgsql-hackers

From Tom Lane
Subject Re: elog/ereport noreturn decoration
Date
Msg-id 13213.1342304172@sss.pgh.pa.us
Whole thread Raw
In response to Re: elog/ereport noreturn decoration  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: elog/ereport noreturn decoration  (Robert Haas <robertmhaas@gmail.com>)
List 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 by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: elog/ereport noreturn decoration
Next
From: Josh Berkus
Date:
Subject: Re: Synchronous Standalone Master Redoux