Subject: Re: detect arithmetic overflow
To: Ciju John <cjohn@cs.nmsu.edu>
From: Martin Husemann <martin@duskware.de>
List: current-users
Date: 08/05/2003 23:45:49
On Tue, Aug 05, 2003 at 02:18:08PM -0600, Ciju John wrote:
> Hi all, I need to detect arithmetic overflow when using signed integers
> (64-bit). I read that a system signal is generated upon an overflow event.
I don't think any of our archs does this for integers. Depending on arch
the processor will set a status bit that you can query (in assembler, but
beware of archs where 64bit is not a native integer type and library routines
are called instead) - or you need to predict the overflow bit value
via bitmask operations.
Martin