Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 32,326 of 33,346    |
|    Francis Glassborow to rado    |
|    Re: postfix operator++    |
|    22 May 12 17:23:47    |
      f29e377d       From: francis.glassborow@btinternet.com              On 22/05/2012 20:10, rado wrote:       >> You have invoked undefined behaviour because your assignment       >> statement modifies x twice without an intervening sequence       >> point. This is always a no no in C and C++ for built-in types. The       >> same rule applies to struct/class types except that in most       >> instances where it looks as this has been done (2 modifications to       >> same memory between sequence points) there are some hidden sequence       >> points because overloaded operators are actually function calls.       >       > I wonder why decent compilers don't issue a warning in such cases. Or       > maybe they do. Does anybody know?       > -- Radoslav Getov              Well GNU GCC 4.7 with -Wall issues a warning                     --        [ See http://www.gotw.ca/resources/clcm.htm for info about ]        [ comp.lang.c++.moderated. First time posters: Do this! ]              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca