Re: cleanup in code - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: cleanup in code
Date
Msg-id 52CC5BC0.8010502@vmware.com
Whole thread Raw
In response to Re: cleanup in code  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: cleanup in code
List pgsql-hackers
On 01/07/2014 05:20 PM, Tom Lane wrote:
> David Rowley <dgrowleyml@gmail.com> writes:
>> I think it will be like Andres said up thread, to stop multiple evaluations
>> of the expression passed to the macro.
>
> Exactly.  We are not going to risk multiple evals in a macro as commonly
> used as elog/ereport; the risk/benefit ratio is just too high.
>
> I don't see anything wrong with suppressing this warning by inserting
> an additional return statement.  The code is already plastered with such
> things, from the days before we had any unreachability hints in
> elog/ereport.  And as I said upthread, there is no good reason to suppose
> that the unreachability hints are always recognized by every compiler.
> I take this behavior of MSVC as proof of that statement.

Yeah, I was just surprised because I thought MSVC understood it. 
Committed the additional return statement.

- Heikki



pgsql-hackers by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: Re: How to reproduce serialization failure for a read only transaction.
Next
From: Gabriele Bartolini
Date:
Subject: Re: [PATCH] Support for pg_stat_archiver view