Vincent Lefevre wrote: [...] > int foo (int d) > { > int m; > m = d * 64; > return m; > } [...] > while the cause of a potential bug would be the same. For consistency, > GCC should have warned for the first code too.
No, there is no optimisation in that case, so there is no warning. It only warns when it uses the knowledge that "(signed) integer overflow isn't possible" to optimise away some redundant code. Cheers, -- Raphael Geissert - Debian Developer www.debian.org - get.debian.net -- 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/ligjem$plj$1...@ger.gmane.org