On 2014-01-28 16:19:11 -0500, Tom Lane wrote:
> Christian Kruse <christian@2ndQuadrant.com> writes:
> > According to http://llvm.org/bugs/show_bug.cgi?id=18644#c5 this is not
> > a compiler bug but a difference between gcc and clang. Clang seems to
> > use a left-to-right order of evaluation while gcc uses a right-to-left
> > order of evaluation. So if errmsg changes errno this would lead to
> > errno == ENOMEM evaluated to false.
>
> Oh! Yeah, that is our own bug then.
Pretty nasty too. Surprising that it didn't cause more issues. It's not
like it would only be capable to cause problems because of the
evaluation order...
> > Should we work on this issue?
>
> Absolutely. Probably best to save errno into a local just before the
> ereport.
I think just resetting to edata->saved_errno is better and sufficient?
Greetings,
Andres Freund
-- Andres Freund http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services