Ian Jackson dixit: >> If the architecture uses two's complement, however, then the code is >> correct. > >Unfortunately adversarial optimisation by modern compilers means that >this kind of reasoning is no longer valid. > >The compiler might easily see that your code unconditionally performs >a computation with undefined behaviour, and delete it.
And GCC is a repeat offender which actually does do that. (mksh’s internal guaranteed-to-wrap-around signed 32-bit integer arithmetics is implemented using only C unsigned integer types, since a while, due to this. Yes, speed hit, especially since the CPUs (except DSPs, possibly) could all do this correctly.) bye, //mirabilos -- In traditional syntax ' is ignored, but in c99 everything between two ' is handled as character constant. Therefore you cannot use ' in a preproces- sing file in c99 mode. -- Ragge No faith left in ISO C99, undefined behaviour, etc. -- To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/pine.bsm.4.64l.1404101147250.23...@herc.mirbsd.org