------- Comment #6 from rguenth at gcc dot gnu dot org  2006-03-22 12:19 -------
Another one:

int foo(int i)
{
  i = ++i;
  return i;
}

I think the point is we should not warn for pre-increment, only post-increment.
Or can someone come up with a testcase that has undefined evaluation order just
by using pre-increment?  One with two pre-increments:

int foo(void)
{
 int i = 1;
 i = (++i == 2) + ++i;
 return i;
}

This is certainly undefined.  But with one pre-increment only?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18050

Reply via email to