[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
It is a gcc-3.2 protocol issue (was Re: Factory method "lost" :-))
From: |
Paul Johnson |
Subject: |
It is a gcc-3.2 protocol issue (was Re: Factory method "lost" :-)) |
Date: |
Mon, 09 Sep 2002 08:59:30 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020606 |
When I try to compile Swarm with gcc-3.2, I see several new warnings of
the type that Alessandro describes. I have reported a couple of other
bugs to the gcc team and they say they are working on it. They could
be/probably are all related to a flaw in handling of protocols.
I do not get this warning/error you mention here, but I get the same for
Customize class and ObjectSaver. It appears to me that gcc-3.2 is aiming
to do MUCH MUCH tighter checking on objects to make sure they implement
all the methods that their protocols promise and also there is tighter
checking to make sure that when an class adopts a protocol, then that
class is not allowed to use any methods that are not listed in its
protocols and are not implemented directly. In other words, the compiler
can't see inherited methods unless they are listed in a protocol.
Maybe if gcc-3.2 gets fixed up in the ways they promise, then these
other issues will disappear too.
But you can look in the swarm source to see why they happen. Look around
in the hierarchy of classes and protocols:
EZGraph has the superclass simtoolsgui/GUIComposite. That one has the
superclass SwarmObject, which we know has +createBegin. So the method
does in fact get inherited.
That means the problem is a protocol issue.
GUIComposite inherits from SwarmObject but it only adopts one protocol,
<GUIComposite>. Now, go look at simtoolsgui/simtools.h and you see the
GUIComposite protocol.
I cannot find any place in the hierarchy above GUIComposite any protocol
that lists a create time +createBegin. You trace the protocol hierarchy
back to WinodowGeometryRecordName, you see what I mean.
Hence the compiler does not know that an EZGraph is able to use
+createBegin. I bet if you put a createBegin into the GUIComposite
protocol, the warning would go away.
If your build of Swarm gets up to the point where it is complaining like
that, you might try changing the Makefile so that Werror becomes
Wno-error. I found in one recent test I could build/compile a working
Swarm by just forcing it to ignore these new gcc warnings.
Glen has rightly warned me to try to find out what's wrong in gcc rather
than blindly changing the Swarm source, and I'm on the way there. But if
you just want a glimmer of hope, then try some hacks and see if
something works.
address@hidden wrote:
Perrone Alessandro writes:
> Can anyone explain what means this warning?
> EZGraph.m: In function `-[EZGraph createEnd]':
> EZGraph.m:203: warning: cannot find class (factory) method
> EZGraph.m:203: warning: return type for `createBegin:' defaults to id
> Any hints how to solve it?
> In my compilation I have several of this warnings
This usually means that your includes have gotten screwed up.
It should find a declaration for that method from defobj.h, which
should be included by one of the header files you import.
--
Paul E. Johnson email: address@hidden
Dept. of Political Science http://lark.cc.ku.edu/~pauljohn
University of Kansas Office: (785) 864-9086
Lawrence, Kansas 66045 FAX: (785) 864-5700
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.