• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how to disable floating point exceptions/arithmetic exceptions?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to disable floating point exceptions/arithmetic exceptions?


  • Subject: Re: how to disable floating point exceptions/arithmetic exceptions?
  • From: Rua Haszard Morris <email@hidden>
  • Date: Fri, 17 Aug 2007 15:57:37 +1200

That's a very valid point, I was ignoring that distinction!

I think the upshot is the same, there isn't a way to prevent crashreporter noticing the mach exception on divide by zero...

Thanks
Rua HM.

On 17/08/2007, at 3:52 PM, Robert Purves wrote:


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
  • Follow-Ups:
    • Re: how to disable floating point exceptions/arithmetic exceptions?
      • From: Steve Checkoway <email@hidden>
References: 
 >Re: how to disable floating point exceptions? (From: Robert Purves <email@hidden>)

  • Prev by Date: Re: how to disable floating point exceptions?
  • Next by Date: Re: Custom data formatter for pthread_mutex_t?
  • Previous by thread: Re: how to disable floating point exceptions?
  • Next by thread: Re: how to disable floating point exceptions/arithmetic exceptions?
  • Index(es):
    • Date
    • Thread