------- Comment #11 from photon at seznam dot cz  2009-07-15 16:55 -------
(In reply to comment #8)
> For:
> 
>         c += (char) 1;
> 
> The value can change as you have a wrapping if c is CHAR_MAX.
> 
> Likewise with:
>     c += c2;
> 

The value cannot change even if an overflow occurs.

{
        unsigned char c = 0xff;
        c += 1;
        // c is 0 here

        c = 0xff;
        c = (unsigned int)c + 1;
        // c is 0 here
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40752

Reply via email to