Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble with C++ exceptions



On Monday, July 28, 2003, at 02:40 AM, Bjvrn Giesler wrote:

Hi,

I'm trying to catch an exception using a set_terminate handler, which
re-throws the exception and tries to catch it using a number of
templates, including "...". On Linux, this works fine; on OS X, the
handler gets stuck in an endless recursion, re-throwing the exception
and being called over and over again.

I've attached the problematic isolated code; the output is as follows:

On OSX 10.2.6, gcc 3.1 20020420 (prerelease):
$ gcc -o testprogram Main.cc -lstdc++
$ ./testprogram
Re-throwing.
Re-throwing.
Re-throwing.
[... etc until the stack overflows]

On Linux 2.4.19, gcc 3.2:
$ gcc -o testprogram Main.cc -lstdc++
$ ./testprogram
Re-throwing.
MyException
Aborted

Have you tried using gcc 3.3 that Apple has released?

Head over to ADC (http://connect.apple.com/cgi-bin/WebObjects/MemberSite) to download it.

-Shawn
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Trouble with C++ exceptions (From: Björn Giesler <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.