Re: “x--” would self-add before opration "--" ?

2010-06-07 Thread pem
Sorry for missing version info of my compiler: $ gcc -v Using built-in specs. COLLECT_GCC=/usr/bin/gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/lto- wrapper Target: x86_64-unknown-linux-gnu Configured with: ../configure --prefix=/usr --enable- languages=c,c++,fortran,objc,o

Re: “x--” would self-add before opration "--" ?

2010-06-07 Thread Paolo Bonzini
On 06/07/2010 09:38 AM, pem wrote: I am not familar with both c++ and compiler implementation, donot konw why the results are differnt for gcc and clang. Anyone could help and explain this difference for me? First of all, this would be a question for gcc-h...@gcc.gnu.org. This mailing list is

“x--” would self-add before opration "--" ?

2010-06-07 Thread pem
Hello list, Yestoday I encounter this problem during a test: 1int x = 11; 2std::cout<< x << x-- << ++x; I think it should be : 11 11 11 I wrote the fellowing code : #include int main() { int x = 11; std::cout<< x << x-- << ++x << std::endl; } compile the code above wi