gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash with new-style exceptions on FreeBSD amd64


From: Richard Frith-Macdonald
Subject: Re: Crash with new-style exceptions on FreeBSD amd64
Date: Thu, 15 Mar 2007 08:46:52 +0000


On 15 Mar 2007, at 08:37, Michael Gardner wrote:


I've got gcc-4.1.3_20070305, also compiled from ports, and it should
definitely support native ObjC exceptions (especially since I was able
to get them to work with the command in my first email). I've attached
gnustep-make's config.log, but I found something interesting about the
failed program:

#include <stdlib.h>
#include <objc/Object.h>

int main(int argc, char **argv)
{
     Object *o=nil;
     @try
     {
             o=[Object new];
             @throw o;
     }
     @catch (id foo)
     {
             if (o!=foo)
                     return 1;
     }
     return 0;
}

I saved this as 'conftest.c' and then compiled with the same command
that configure used:

gcc41 -o conftest -O2 -pipe   -x objective-c -I.   -fgnu-runtime
-fobjc-exceptions   conftest.c -lobjc  -pthread

The program crashed, as expected. However, on a whim I renamed
'conftest.c' to 'conftest.m', recompiled, and it ran! I thought the
file extension didn't matter when the language is manually specified
with -x as above, so what could be going on here? I'm also emailing my
config.log to the FreeBSD port's maintainer, but at this point I'm not
sure whether it's an issue with gnustep-make, its FreeBSD port, or
even gcc itself. Can somebody shine some light on this?

I thought that compiling with '-x objective-c' was supposed to have the same effect as compiling a file with a .m extension too. If that understanding is correct, I don't see how the behavior you are seeing could be anything other than a compiler bug.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]