This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Do C++ signed types have modulo semantics?
- From: Morten Welinder <mwelinder at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 27 Jun 2005 10:39:36 -0400
- Subject: Re: Do C++ signed types have modulo semantics?
- Reply-to: Morten Welinder <mwelinder at gmail dot com>
| signed types are undefined on overflow. [5/5] and [3.9.1/2,3]
> But a compiler could define them to be modulo -- that is the whole
> point. The paragraph does not say they don't "modulo".
True, but you are going to have to deal with the run-time version of
(int)0x80000000 / -1
which is unpleasant in the sense that Intel processors will trap and not
do anything modulo-like.
Morten