lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 2014-09-18 05:08, Philipp Janda wrote:


The order of evaluation of subexpressions is unspecified, but multiple
modifications of an lvalue between two sequence points invokes
undefined behavior.

As is

int n, k = 5;
n = k + k++;

up to at least C99, because although there's only one modification of
k between sequence points, there's a read of k that doesn't determine
the modifying value.

I've yet to look into what C11 says about sequencing and don't know
whether this is still undefined behavior.