gnustep-dev
[Top][All Lists]
Advanced

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

Re: Release check


From: Adrian Robert
Subject: Re: Release check
Date: Thu, 02 Jun 2005 12:18:51 -0400


On Jun 2, 2005, at 11:52 AM, David Ayers wrote:

Adrian Robert wrote:


On Jun 2, 2005, at 3:29 AM, David Ayers wrote:


[snip]

- (int)compare:anotherObject;
- shallowCopy;
- (const char *)name;

[snip]


Under what circumstances would it be necessary to include Protocol.h?
Does this affect just the libraries or also user code?

Please excuse me, I missed the second question.  It currently affects
"user code" that does something like:

@interface FooBar : NSObject
- (NSString *)name;
@end

void
someCode(void)
{
   [[[someArray objectAtIndex:0] name] length];
}
as this will warn that const char * is an invalid receiver for messages
(like length in this case). Since both are pointers, everything is fine
at runtime.

This seems like a problem with gcc's support for alternative root objects. Is there no way to tell the compiler to assume that id is NSObject instead of Object? (Or do all root objects inherit from Object? If this isn't a ridiculous question I can look into putting it in as an RFE for gcc I guess..)

Also, it seems like a pain to need to include Protocol.h to ask an object if if conformsTo: @protocol(...), but this is the way NeXT did it so I guess we are stuck with that. If I were redesigning this from scratch I would make sure all Objective-C language features were pulled in by one include -- if that.





reply via email to

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