[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New style exception handling
From: |
Larry Campbell |
Subject: |
Re: New style exception handling |
Date: |
Tue, 12 Jun 2007 10:50:31 -0400 |
Here's the program:
#include <Foundation/Foundation.h>
void throwException()
{
NSLog(@"Throwing");
@throw [NSException exceptionWithName:@"new style" reason:@"new
style" userInfo:nil];
}
void test()
{
@try {
NSLog(@"Testing new style catch with throw");
throwException();
} @catch (NSException *e) {
NSLog(@"caught a throw");
NSLog(@"throwException() threw %@", e);
}
}
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [NSAutoreleasePool new];
test();
[pool release];
return 0;
}
I'm compiling for and on linux 2.4 on a Pentium 4 processor. I am not
using gnustep-objc; I'm using the libobjc from gcc 4.1.
- lc
On Jun 12, 2007, at 10:27 AM, Andrew Pinski wrote:
On 6/12/07, Larry Campbell <lcampbel@akamai.com> wrote:
I wrote a trivial test program to try out the new style exception
handling (@try/@throw/@catch/@finally). It works fine on Mac OS X,
but on gnustep (gcc 4.1, gnustep-base 1.13.0) the @throw immediately
dumps core.
Is this expected to work?
It should work with GCC 4.1. Can you come up with a small testcase
which shows the issue. Also which target are you using?
Thanks,
Andrew Pinski