Re: Why "global" variable can't be processed properly?

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

 




Thanks for all reply

I found the problem is funny ! It look like no way can effect
GCC to change his evaluating order.
 
I meet this situation in the linux programing by accident and
intuitively I think the right hand side of assignment operator
will be first evaluation, so i write same that code. If no change
of iCurArrayIdx in the GetNewValue(), all run correctly!

I used C in multi platforms many years and never encountered this
unspecified, :-<. I also compiler the source code in Intel C++ Compiler
and Sun Studio 12 C/C++, all the run result is “1”. 

I hope GCC can be consistent with the others. Maybe that's a better way.

--horde






      ___________________________________________________________ 
  好玩贺卡等你发,邮箱贺卡全新上线! 
http://card.mail.cn.yahoo.com/


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux