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 did:

elog(mylevel++, "Something bad just happened");

With assigning this to a variable the user will have the mylevel increase
by 1, but if we didn't then it would get increase more times.

I didn't look at all the elog usages in core, but my guess is that we're
probably not using any expressions like this in elog, but we can't really
speak for any third party code which uses the macro. Likely to get rid of
that variable something would have to go into the release notes to get
users to check for volatile expressions being used in elog and fix them up.

The only other way to fix it that I can think of is the patch you posted
above which is pretty much the same one as I posted on the other thread too.


David Rowley

Reply via email to