How to get a VS or Xcode warning with something like "x = x ++"?

In the spirit of undefined behavior associated with sequence points such as "x = ++ x", is it really undefined? , how does the compiler get to complain about such code?

In particular, I use Visual Studio 2010 and Xcode 4.3.1, the latter for the OSX application, and did not warn about this. I even turned on VS2010 warnings on everything, and he happily compiled it. (For the record, VS2010 added 1 to the variable, in which the Xcode version saved the variable unchanged.)

+5
source share
1 answer

AFAIK, Visual Studio . , . , , , , . , *p = ++*q, p q . , .

+2

All Articles