From: Christopher H. <he...@st...> - 2005-03-11 18:41:51
|
Felix Kater wrote: > Hi, > > I don't know if this is a compiler error, nor do I know if this is > alreay known. Just in case it still matters: > > > This code is a bit strange but worked when compiled with mingw-3.1.0: > > > while(myint > 0){ > > /* some stuff */ > > myint=myint--; > } > > The same code does not work using mingw-3.2.0-rc-3. myint is never > counted down. Don't do that. The C language spec is ambiguous as to what happens to the variable x when you do write code like x = x--; and the compiler is free to do whatever it darn well pleases. And whatever it does is probably not what you expect it to do. Write that code as either: x--; or x = x - 1; |