Re: [HACKERS] cleanup in code

2014-01-07 Thread Tom Lane
David Rowley dgrowle...@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

Re: [HACKERS] cleanup in code

2014-01-07 Thread Heikki Linnakangas
On 01/07/2014 05:20 PM, Tom Lane wrote: David Rowley dgrowle...@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;

Re: [HACKERS] cleanup in code

2014-01-07 Thread Amit Kapila
On Wed, Jan 8, 2014 at 1:25 AM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 01/07/2014 05:20 PM, Tom Lane wrote: David Rowley dgrowle...@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.

Re: [HACKERS] cleanup in code

2014-01-06 Thread Heikki Linnakangas
On 01/04/2014 07:20 AM, Amit Kapila wrote: 1. compiling with msvc shows warning in relcache.c 1e:\workspace\postgresql\master\postgresql\src\backend\utils\cache\relcache.c(3959): warning C4715: 'RelationGetIndexAttrBitmap' : not all control paths return a value Attached patch

Re: [HACKERS] cleanup in code

2014-01-06 Thread David Rowley
On Mon, Jan 6, 2014 at 11:38 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 01/04/2014 07:20 AM, Amit Kapila wrote: 1. compiling with msvc shows warning in relcache.c 1e:\workspace\postgresql\master\postgresql\src\backend\ utils\cache\relcache.c(3959): warning C4715:

Re: [HACKERS] cleanup in code

2014-01-06 Thread Andres Freund
On 2014-01-06 23:51:52 +1300, David Rowley wrote: On Mon, Jan 6, 2014 at 11:38 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 01/04/2014 07:20 AM, Amit Kapila wrote: 1. compiling with msvc shows warning in relcache.c 1e:\workspace\postgresql\master\postgresql\src\backend\

Re: [HACKERS] cleanup in code

2014-01-06 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On Mon, Jan 6, 2014 at 11:38 PM, Heikki Linnakangas hlinnakan...@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.

Re: [HACKERS] cleanup in code

2014-01-06 Thread Andres Freund
On 2014-01-06 09:54:15 -0500, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On Mon, Jan 6, 2014 at 11:38 PM, Heikki Linnakangas hlinnakan...@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

Re: [HACKERS] cleanup in code

2014-01-06 Thread David Rowley
On Tue, Jan 7, 2014 at 12:06 AM, Andres Freund and...@2ndquadrant.comwrote: On 2014-01-06 23:51:52 +1300, David Rowley wrote: I looked at this a while back here: http://www.postgresql.org/message-id/caaphdvqosb4nc3og0xoboj2fma-6akihuwsad43rlekqk6s...@mail.gmail.com And found that

Re: [HACKERS] cleanup in code

2014-01-06 Thread Amit Kapila
On Mon, Jan 6, 2014 at 4:08 PM, Heikki Linnakangas hlinnakan...@vmware.com wrote: On 01/04/2014 07:20 AM, Amit Kapila wrote: 1. compiling with msvc shows warning in relcache.c 1e:\workspace\postgresql\master\postgresql\src\backend\utils\cache\relcache.c(3959): warning C4715:

Re: [HACKERS] cleanup in code

2014-01-06 Thread David Rowley
On Tue, Jan 7, 2014 at 7:46 PM, Amit Kapila amit.kapil...@gmail.com wrote: Having said above, I think there must be a reason to have elevel_ which I am not aware. I think it will be like Andres said up thread, to stop multiple evaluations of the expression passed to the macro. If someone

[HACKERS] cleanup in code

2014-01-03 Thread Amit Kapila
1. compiling with msvc shows warning in relcache.c 1e:\workspace\postgresql\master\postgresql\src\backend\utils\cache\relcache.c(3959): warning C4715: 'RelationGetIndexAttrBitmap' : not all control paths return a value Attached patch remove_msvc_warning.patch to remove above warning 2. It seems