# HELP PLEASE: EXC_BAD_ACCESS _Complex double return



## mstath (Aug 4, 2008)

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)barcmplx)zcmplx)c;
@end

@implementation
- (cmplx)barcmplx)zcmplx)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


----------



## xdev74 (Oct 20, 2008)

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?


----------



## mstath (Oct 21, 2008)

xdev74 said:


> 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.


----------

