This is the mail archive of the gcc@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] | |
Hi Paul,I have submitted that one to gcc's GNATS.ThanksSo I am emboldened to ask about another problem that did not affect gccI had a look at your code, and at a quick glance I think your 'Member'
3.0.4 but does arise in 3.1 and 3.2.
This arises when we try to compile the Swarm libraries
(http://www.swarm.org).
Here is the compiler warning we see:
../../../swarm-2.1.140.20020514/src/analysis/Averager.m: In function
`-[Averager update]':
../../../swarm-2.1.140.20020514/src/analysis/Averager.m:153: warning:
comparison of distinct pointer types lacks a cast
make[1]: *** [Averager.lo] Error 1
The compiler's warning focuses on the comparison
GETLOC (iter) == (id) Member
variable is of type 'id<Index>'. When you cast it to 'id', because of the
same compiler bug we have been talking about in the other email :-), the
cast is ignored.
Then, you are comparing the result of GETLOC (iter) - which is an 'id',
with Member, which is of type 'id<Index>' (your cast for it to be an 'id'
having been ignored!) - and the compiler emits a warning because you are
comparing an 'id' with an 'id<Index>'.
Incidentally, I suspect even this is wrong :-) because if you compare an
'id' with any type of other object, no warning should be produced. I
think traditionally in ObjC the type 'id' precisely means 'disable any
compile time type checking when this object is involved'. I've already
produced a patch to fix such warnings for type checking, but I need to
double-check its logic and tidy it up.
To me it looks like your code is correct, and it's the same compiler bugSo, if you know whether there is a way I should rewrite the Averager class, let me know. If you think it is a gcc bug, let me know.
as before.
Thanks for reporting!
-------------------------------------------------------------- Ziemowit Laski 1 Infinite Loop, MS 301-2K Mac OS X Compiler Group Cupertino, CA USA 95014-2083 Apple Computer, Inc. +1.408.974.6229 Fax .5477
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |