Extern "C" -- Function Parameters Corrupted on Mactel??
Extern "C" -- Function Parameters Corrupted on Mactel??
- Subject: Extern "C" -- Function Parameters Corrupted on Mactel??
- From: Ben Weiss <email@hidden>
- Date: Thu, 18 May 2006 00:14:02 -0700
I'm running into a bizarre situation trying to combine C and C++ code
as follows:
File: stuff.h:
extern "C" long Test2(long x, float y);
File: stuff.cpp:
long Test2(long x, float y) { return x + (long)y; } // or whatever
File: main.c:
long Test1(long x, float y) { return Test2(x, y); }
Inside Test1, the values for x and y are correct (say, 16 and 4,
respectively)... but when Test2 is entered, the value of y is
corrupted! (usually 0 or 1.0e-45 or something.) This is not just a
debugger issue; in my actual project the corrupted value causes
downstream code to crash.
The same code works perfectly on PowerPC; it only has this problem on
Mactel, and only with floating-point parameters. Is there a compiler
bug here, or am I overlooking something obvious?
Thanks,
Ben
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden