discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Possible MacOS X compier problem


From: Bill Northcott
Subject: Re: Possible MacOS X compier problem
Date: Tue, 29 Jul 2003 16:03:06 +1000

Sorry about the long delay responding to that last post, but I needed time 
to think about it.

David Ayers <d.ayers@inode.at> wrote on 24/07/2003 06:11:34 PM:
> Maybe you could post the full implmenetation of the setQuotedObject:
> method and it's declaration in the coresponding header file. 

If you want, you can find it at http://savannah.nongnu.org/projects/swarm.
You also need tcl/tk, blt, png, gperf, gsed and optionally HDF5 and of 
course the FSF compiler, if want to build it on MacOS X.
It is rather too much to post!

> I'm starting to believe that you're a victim of a change in convention 
from
> the pre OpenStep days.  Back in the early days, methods were supposed to
> always return self, unless they had other meaningful values to return.
> Therefor an unspecified signature in the header:

> -setSomeValue:value;

> impliied

> - (id)setSomeValue:(id)value;

> so that the type of nesting you code example uses could work.  I believe
> this is no longer the case (I must admit that I don't knowingly use such
> code, so I'm not sure how the the compiler currently acts)  Instead the
> header may currently imply:

> - (void)setSomeValue:(id)value;

> Now, if that is the case and your implementation of -setSomeValue:
> actually ends in a:

> return self;

> but the caller didn't prepare the stack receive the return value
> (because the header didn't expicitly state that the method will return
> an id), you will have undefined behavior.

I think you are on to something here.  Swarm code goes back a long way. 
Here is the protocol for ArchiverQuoted Objects:

@protocol ArchiverQuoted <RETURNABLE>
//S: Archiver serialization object for (quote x) or 'x
//D: Archiver serialization object for (quote x) or 'x
CREATING
- setQuotedObject: value;
USING
- getQuotedObject;
- (void)lispOutDeep: (id <OutputStream>)stream;
@end

Not a return type to be seen!  I don't really want this to be the answer 
but I have to face the fact it explains all the observed symptoms.  There 
are thousands of these :-((

Many thanks for the thoughts - all too helpful!

Bill Northcott
Swarm Development Group




reply via email to

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