Re: Usage of -ftrapv

2006-06-22 Thread Paulo J. Matos
On 19/06/06, Eric Botcazou <[EMAIL PROTECTED]> wrote: > By the way, -ftrapv only works on integral types. When it works. Last time I took a look, it was easily wiped out by optimization. So, it is of no use then... :-( -- Eric Botcazou -- Paulo Jorge Matos - pocm at sat inesc-id pt Web

Re: Usage of -ftrapv

2006-06-19 Thread Eric Botcazou
> By the way, -ftrapv only works on integral types. When it works. Last time I took a look, it was easily wiped out by optimization. -- Eric Botcazou

Re: Usage of -ftrapv

2006-06-19 Thread Ben Elliston
> I'd like to catch automatically over/underflows on floating point > and integer arithmetic. I thought -ftrapv would do the trick but I > don't really understand how it works. By the way, -ftrapv only works on integral types. Ben

Re: Usage of -ftrapv

2006-06-16 Thread Mike Stump
On Jun 16, 2006, at 5:43 PM, Paulo J. Matos wrote: I'd like to catch automatically over/underflows on floating point Wrong list. You want gcc-help... Does it mean that if I use this, exceptions are thrown when I have an over/underflow? No, it it meant that, the documentation would say that

Re: Usage of -ftrapv

2006-06-16 Thread Andrew Pinski
On Jun 16, 2006, at 5:43 PM, Paulo J. Matos wrote: int main() { unsigned int maxi = std::numeric_limits::max(); maxi++; This is well defined as unsigned overflow is defined as wrapping. -- Pinski

Usage of -ftrapv

2006-06-16 Thread Paulo J. Matos
Hi all, I'd like to catch automatically over/underflows on floating point and integer arithmetic. I thought -ftrapv would do the trick but I don't really understand how it works. From the latest manual online: -ftrapv This option generates traps for signed overflow on addition, subtraction, mu