|Subject:||Re: Possible MacOS X compier problem|
|Date:||Wed, 23 Jul 2003 14:02:22 +0200|
|User-agent:||Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030507|
Bill Northcott wrote:
The following code works with the FSF compiler but not with the recent (gcc-1465) Apple version. return [[[ArchiverQuoted createBegin: aZone] setQuotedObject: [self getExpr]] createEnd];or isn't it? Then the result of the above concatenation would be highly architecture dependent I think. It probably works on ix86 because the arguments are passed on the stack and not in registers, but that's rather a guess.Thanks for the thought, but I don't think that can be the problem. The code works using the FSF compiler from gcc.gnu.org, but not with the Apple one. Both compilers use all the same build tools other than the compiler. In both cases the assembler, static and dynamic linkers are the Apple ones. Arguments are passed in registers by both compilers because that is the Mach-O standard.
If in fact, the setQuotedObject: method returns void and does not return the receiver, then the code is wrong and the compiler should be warning you about not ignoring the return value. The fact the it seems to work because the receivers address is left somewhere in in memory/registiers that happen to be where the next method invocation reads the parameter for sending the message is pure luck. You should expect sporadic segmentation faults. The bug is that the compiler isn't compiles it at all, or isn't at least warning you about it..
|[Prev in Thread]||Current Thread||[Next in Thread]|