NetBSD-Bugs archive

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

Re: port-hp300/50852: src/sys/arch/hp300/stand/common/ite.c:239: bad expression



On Sat, Feb 27, 2016 at 12:10:21AM +0100, Joerg Sonnenberger wrote:
> On Fri, Feb 26, 2016 at 05:04:46PM -0600, Dave Huang wrote:
> > How is the code in question different from i = ++i;, which I've always
> > been told is undefined? The assignment operator does not introduce a
> > sequence point.
> 
> At least in C11, it does.

Hmm, well I'm no language lawyer, but footnote 84 in section 6.5 of
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf (the C1X
draft) says "This paragraph renders undefined statement expressions
such as i = ++i + 1;"

However, I did see someone say that i = ++i + 1 is well-defined
starting in *C++* 11.


Home | Main Index | Thread Index | Old Index