[lazarus] classesh.inc change required

Marc Weustink Marc.Weustink at cuperus.nl
Wed Dec 22 13:02:44 EST 1999


+ -----Original Message-----
+ From: Kevin Berry [mailto:kevinbe71 at yahoo.com]
+
+ But TMyFunc isn't just a pointer, it is a type that is
+ a function returning an integer.  Correct me if I'm
+ wrong here...

Thats correct.

+ I can't verify this with FPC at the
+ moment.

If you say that the @ operator just returns a untyped pointer then assinging
to MyVar (:TMyFunc) is assigning a Pointer to MyVar.

+ Even though you are taking the address of the function
+ (and thus returning a pointer) surely the compiler
+ doesn't just assign any pointer value to the var of
+ type TMyFunc.  You'd end up with a rather nasty crash
+ if it allowed you to assign any address to the
+ function variable and then called that function.

That was my point. Ether you do type checking or you don't.
If you do it sometimes it is even more confusing than where this thread was
about.

Marc






More information about the Lazarus mailing list