Re: [HACKERS] cleanup in code

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

Re: [HACKERS] cleanup in code

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

Re: [HACKERS] cleanup in code

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

Re: [HACKERS] cleanup in code

2014-01-06 Thread David Rowley
On Tue, Jan 7, 2014 at 7:46 PM, Amit Kapila 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 did: elog(mylevel++,

Re: [HACKERS] cleanup in code

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

Re: [HACKERS] cleanup in code

2014-01-06 Thread David Rowley
On Tue, Jan 7, 2014 at 12:06 AM, Andres Freund wrote: > 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 because elevel was

Re: [HACKERS] cleanup in code

2014-01-06 Thread Andres Freund
On 2014-01-06 09:54:15 -0500, Tom Lane wrote: > Andres Freund writes: > >> On Mon, Jan 6, 2014 at 11:38 PM, Heikki Linnakangas > >> wrote: > >>> Hmm, I thought we gave enough hints in the elog macro to tell the compiler > >>> that elog(ERROR) does no return, since commit > >>> b853eb97182079dcd

Re: [HACKERS] cleanup in code

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

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 > wrote: > > > On 01/04/2014 07:20 AM, Amit Kapila wrote: > > > >> 1. compiling with msvc shows warning in relcache.c > >> 1>e:\workspace\postgresql\master\postgresql\src\backend\ > >> utils\ca

Re: [HACKERS] cleanup in code

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

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 1>e:\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_warnin

[HACKERS] cleanup in code

2014-01-03 Thread Amit Kapila
1. compiling with msvc shows warning in relcache.c 1>e:\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