This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Document arithmetic overflow semantics
- From: Andrew Haley <aph at redhat dot com>
- To: dewar at gnat dot com (Robert Dewar)
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 13 Feb 2003 19:02:50 +0000 (GMT)
- Subject: Re: [PATCH] Document arithmetic overflow semantics
- References: <20030213185421.B4E47F2D77@nile.gnat.com>
Robert Dewar writes:
> > 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.
What do you mean by this, exactly? Java is defied as having signed
two's complement arithmetic.
Andrew.