comparing pointers to void functions
"Gary S. Moss", VLD/VMB
moss at BRL.MIL
Thu May 31 00:07:06 AEST 1990
< if (thing->formstart == bgnpolygon)
< The compiler says "operands of == have incompatible types".
Chris,
I ran into this exact problem yesterday. It looks like a compiler
bug; I tried just about everything comparing a pointer to a function of
type void to the function name with the same result. Casting each side
to a generic pointer type shuts up the compiler, but this is a non-portable
workaround since there is no guarantee in ANSI C that a function pointer
will fit in a generic *object* pointer type:
#ifdef mips
if( (void *) thing->formstart == (void *) bgnpolygon )
#endif
Anyone at SGI want to wedge a fix in to the next release?
More information about the Comp.sys.sgi
mailing list