http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46619
--- Comment #14 from Eskil Steenberg <eskil at obsession dot se> 2010-11-23 22:06:39 UTC --- Hi again! > because the c standard has specific rules about integral types smaller > than > int; they are all promoted to int. promoting a value to one type in order to do an operation that the type can not express the answer to, only to then promote it to another that can, seams absolutely stupid to me, but i guess the C spec is stupid then. >> Assuming the silliness above is right, it still shouldn't matter. > > Oh you forgot that signed integer overflow in C/C++ is undefined which is > what > the warning is about in the first place. Not true. it is not undefined, it is implementation specific. The line after can only be optimized away if you know that the behavior you specify in your implementation can only yield values that render it void. your implementation clearly outputs values that don't do that. If I get a value from an implementation specific behavior, and use it in a operation clearly defined in the c spec, you still need to do that operation. This is fun! Cheers E the line that gcc do optimize away is