This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Document arithmetic overflow semantics
- From: dewar at gnat dot com (Robert Dewar)
- To: aph at redhat dot com, roger at www dot eyesopen dot com
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org, rth at redhat dot com
- Date: Thu, 13 Feb 2003 13:54:21 -0500 (EST)
- Subject: Re: [PATCH] Document arithmetic overflow semantics
> 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.