HELP PLEASE: EXC_BAD_ACCESS _Complex double return

mstath

Registered
Hi,

This is the scenario...

typedef _Complex double cmplx; //http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.1/gcc/Complex.html

@interface Foo : NSObject
{}
- (cmplx)bar:(cmplx)z:(cmplx)c;
@end

@implementation
- (cmplx)bar:(cmplx)z:(cmplx)c
{ return pow(z,2)+c; }
@end

In main() for shell utility tool...
#import <complex.h>
#import "Foo.h"

cmplx z=1+1*I, c=z;
Foo *foo=[[Foo alloc]init];

z=[foo bar:z:c];
//or just the message to the object ignoring return
[foo bar:z:c];

This is where I get the signal EXC_BAD_ACCESS
Documentation doesnt make it clear on whats wrong: http://developer.apple.com/qa/qa2004/qa1367.html
Everything seems straight forward to me . . . what's going on?

SOMEONE PLEASE HELP! THIS IS DRIVING ME BATTY!!! :?

Thanks in advance!
-mike
 
I'm having the same problem that you are having, but I am only getting it when I am debugging under 64-bit.

Has anyone answered your question?
 
I'm having the same problem that you are having, but I am only getting it when I am debugging under 64-bit.

Has anyone answered your question?

Yes, from another forum: GCC is broken. I'm going to try to use PyObjC for the solution.
 
Back
Top