[PATCH] Document arithmetic overflow semantics

Robert Dewar dewar@gnat.com
Thu Feb 13 18:54:00 GMT 2003


> Java requires strict 32-bit two's complement arithmetic for its ints,
> and PLUS_EXPR isn't guaranteed to do that.  We could, of course,
> generate something like
> 
>    uint((ulong)a + (ulong)b)
> 
> which would be well defined. 

it seems clear that Java should be using unsigned arithmetic for all operations,
since that is the way Java is defined.



More information about the Gcc-patches mailing list