On Fri, Apr 10, 2015 at 2:25 AM, Marko Rauhamaa <ma...@pacujo.net> wrote: > Chris Angelico <ros...@gmail.com>: > >> As far as it's concerned, it's impossible for a CPU register to >> arbitrarily change without notice. It's equally impossible for the >> addition of two positive signed integers to result in a negative >> integer. > > The standard says that any program that takes a signed integer out of > its valid range is broken and deserves anything that happens to it. > > I say it's the standard that is broken.
For application work, it's usually much better to have an integer type like Python's or Pike's int - a signed integer that can never overflow. For low-level bit manipulation work, you usually want an *unsigned* integer of specific size, with well defined wrap-around behaviour. When do you actually want a signed integer with well-defined overflow behaviour? ChrisA -- https://mail.python.org/mailman/listinfo/python-list