Re: Minor codegen silliness in ExecInterpExpr()

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Minor codegen silliness in ExecInterpExpr()
Date: 2017-09-29 03:56:57
Message-ID: 20170929035657.gqq2ajphzjrlhxo6@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2017-09-28 20:01:37 -0400, Tom Lane wrote:
> I wondered how pervasive this behavior is. AFAICS it is *not* required
> by the C standard; C99 does not say that the left operand of assignment
> must be evaluated first, in fact it says that the order of evaluation is
> unspecified.

FWIW, it's being specificied in C++17 ([1]), which seems to make it not
unlikely to end up in C as well.

> but it does suggest that this is worth fixing, and is not just an artifact
> of an old compiler version.

+1, I saw the same in a bleeding edge c++ version.

Greetings,

Andres Freund

[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0145r3.pdf

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-09-29 04:01:35 Re: Minor codegen silliness in ExecInterpExpr()
Previous Message Thomas Munro 2017-09-29 03:34:09 Re: A design for amcheck heapam verification