lkml.org 
[lkml]   [2001]   [Nov]   [22]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 22 Nov 2001 07:03:28 -0500 (EST)
FromAlexander Viro <>
SubjectRe: [BUG] Bad #define, nonportable C, missing {}
On Thu, 22 Nov 2001, Horst von Brand wrote:

> Stevie O <stevie@qrpff.net> said:

> > But x++ is postincrement though. That means the value of 'x' is inserted, 
> > and after the expression is evaluated, x is incremented. Right?> > Nope. x++ increments x sometime (not defined when) after taking the value. 
> >    x = x++ % y
> 
> is wrong: There is just one sequence point at the end of the expression,
> and x is modified twice in between (++ and =).

Or look at it that way: both
	tmp = x % y; x++; x = tmp;
and
	tmp = x % y; x = tmp; x++;
are possible interpretations with different results.  And as usual, compiler
is allowed to do literally anything whenever it sees such beast.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:13    [from the cache]
©2003-2008