The utility of standard's semantics for overflow

Alexandre Oliva aoliva@redhat.com
Fri Jul 1 18:22:00 GMT 2005


On Jun 29, 2005, Olivier Galibert <galibert@pobox.com> wrote:

>   char x = (char)((unsigned char)y + (unsigned char)z)

> is too ugly to live.

Yeah, indeed, one shouldn't assume char is signed :-) :-)

(strictly speaking, you don't, but I thought this would be funny so I
went ahead and posted it)

-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}



More information about the Gcc mailing list