Re: how to disable floating point exceptions?
Re: how to disable floating point exceptions?
- Subject: Re: how to disable floating point exceptions?
- From: Robert Purves <email@hidden>
- Date: Fri, 17 Aug 2007 15:52:53 +1200
Rua Haszard Morris wrote:
Is it possible to prevent an application crashing on EXC_ARITHMETIC
(e.g. divide by zero) on i386?
I believe that on PPC there is no crash, and no crash when running in
rosetta (this is somewhat beside the point however).
You seem to be assuming that the words "Floating point exception"
mean just that. But consider:
$ cat EXC_ARITHMETIC_tester.c
#include <stdio.h>
int main( void )
{
int i;
float f;
f = 1.0/0.0;
printf( "Get here\n" );
i = 1/0;
printf( "but not here\n" );
return 0;
}
$ gcc EXC_ARITHMETIC_tester.c -gused && ./a.out
EXC_ARITHMETIC_tester.c: In function 'main':
EXC_ARITHMETIC_tester.c:8: warning: division by zero
Get here
Floating point exception
"Floating point exception"? I don't think so.
Your energies may be better spent tracking down integer divide-by-zero.
Robert P.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden