Dave Korn wrote:

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

Actually I think a handlable exception, a la Ada, is the best solution.
Whether saturation is appropriate is really problem dependent. If you
are counting the number of primes less than bla, then saturating is not
likely to be helpful. If you are computing some real quantity with
minimal precision, saturation might be helpful

  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.

yes, of course, this would indeed be legitimate, and could be an option.
Almost anything is reasonable as an option. I think it would be quite
reasonable to have options for trapping (-ftrapv working nicely :-) and
for wrap around. But I would not normally make either of these the default
in C.

    cheers,
      DaveK


Reply via email to