Re: cleanup in code - Mailing list pgsql-hackers

From Tom Lane
Subject Re: cleanup in code
Date
Msg-id 2656.1389020055@sss.pgh.pa.us
Whole thread Raw
In response to Re: cleanup in code  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: cleanup in code  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
Andres Freund <andres@2ndquadrant.com> writes:
>> On Mon, Jan 6, 2014 at 11:38 PM, Heikki Linnakangas <hlinnakangas@vmware.com> wrote:
>>> Hmm, I thought we gave enough hints in the elog macro to tell the compiler
>>> that elog(ERROR) does no return, since commit b853eb97182079dcd30b4f52576bd5d6c275ee71.

> But afair the declaration for elog() works in several other places, so
> that doesn't sufficiently explain this. I'd very much expect that that
> variable is complitely elided by any halfway competent compiler - it's
> just there to prevent multiple evaluation should elevel not be a
> constant.

At -O0 (or local equivalent), it would not surprise me at all that
compilers wouldn't recognize elog(ERROR) as not returning.

I don't think there's ever been any expectation that that marking would
be bulletproof.  We added it to permit better code generation, not to
silence reachability warnings.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: ALTER SYSTEM SET command to change postgresql.conf parameters
Next
From: Andres Freund
Date:
Subject: generic pseudotype IO functions?