comparing pointers to void functions

Scum cycy at isl1.ri.cmu.edu
Wed May 30 08:10:28 AEST 1990


Okay, this is a better tested question. I'm having a problem trying to
determine if a pointer is pointing to a certain function. The pointer is
defined as an element in a structure thusly:

struct object {
	...
	void (*formstart) ();
	...
}

As you can see, it is a pointer to a function which returns void. Now, I can
successfully invoke the function as:

struct object *thing;
...
	(thing->formstart)();

However, the compiler will not accept the following attempt to compare the
pointer to the address of the function, even though when they are printed
out, their values are the same:

	if (thing->formstart == bgnpolygon)

The compiler says "operands of == have incompatible types". This doesn't seem
right to me. Can anyone out there help me.... Please?


				-- Chris.
-- 

                                       -- Chris. (cycy at isl1.ri.cmu.edu)
"People make me pro-nuclear." -- Margarette Smith



More information about the Comp.sys.sgi mailing list