This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Objective-C : Do not accept an object as parameter to a method


On Thursday, June 27, 2002, at 03:02 AM, Nicola Pero wrote:


An object is declared as in (NSObject *) [it's really a pointer to the
actual object] - and unless you do low-level things such as casting it to
a pointer to an appropriate struct etc which you can always do - you must
always pass around pointers/references to objects, rather than the objects
themselves.

His patch looks like preventing something like 'NSObject' to be used as
the type for a method argument ... which would be the hypothetical syntax
to pass the object itself (rather than a pointer to the object) as
argument to a method ... this syntax won't currently work as far as I know
(but the compiler doesn't reject it) - and I agree with Devang it's not a
good idea to make it work :-) it's better to raise an error as that might
catch a common typing mistake (leaving out the '*').
Exactly.

Devang


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]