Re: Bugs with Obj-C++ compiler
Re: Bugs with Obj-C++ compiler
- Subject: Re: Bugs with Obj-C++ compiler
- From: Stéphane Sudre <email@hidden>
- Date: Mon, 12 Nov 2001 11:58:09 +0100
On lundi, novembre 12, 2001, at 10:57 , email@hidden wrote:
CCCObjectPositionController.mm:38: warning: multiple declarations for
method `center'
CCCObjectPositionController.mm: In function `':
/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:241:
warning: using `-(void)center'
CCCObjectPositionController.mm: In function `':
Positionnable.h:35: warning: also found `-(struct Point3D)center'
CCCObjectPositionController.mm: In function `':
Positionnable.h:17: warning: also found `-(struct Point3D)center'
CCCObjectPositionController.mm:38: invalid use of void expression
So the OBj-C++ compiler is confused by another method (from NSWindow)
which is completely non-related to my one. Then it CHOOSES THE WRONG
ONE, and ends with an error (last line)! So I can't even ignore that...
After a lot of tries, I finally found a way to overcome that:
NSObject<Positionnable>* item = newSelection; // instead of id
does the trick.
Hope this information will be useful to other people with similar
difficulties. Note that I still don't understand the rationale behind,
so if anyone has an explanation, thanks in advance.
Where is the bug ?
I'm seeing this in Objective-C only. And I don't find this to be a bug
but an expected warning.