----Original Message----
>From: Robert Dewar
>Sent: 29 June 2005 13:14

> Theodore Papadopoulo wrote:
> 
>> So unless you do arithmetics or combinatorics, most of the uses of
>> "wide" (ie > 32b) integral types semantically (ie in the programmer's
>> mind) assume that overflow does not happen in practise in the program.
> 
> I think that's probably right. And in the context of this discussion,
> what does happen to most programs if an int used with this assumption
> overflows? Answer, it's probably a bug, and it is unlikely that
> silent wrapping will correspond to correct behavior.

  In fact, doesn't this suggest that in _most_ circumstances, *saturation*
would be the best behaviour?

  And of course, since it's undefined, a compiler could entirely
legitimately use saturating instructions (on a platform that supports them)
for signed int arithmetic.

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....

Reply via email to