According to Jesper Lund:
(Peter, thanks for the speedy response to my first bug report!)
(No problem. Thanks, Jesper, for the reports and the very helpful example programs!)
Note that, contrary to the "incompatible pointers" problem that I reported a few days ago, the program below does *not* compile (unless the work-around in the example is used).
Fixed now. :)
In the example below, there is one unit (u4) and the main program. The example demonstrates all facets of the bug (type inconsistencies) that I have discovered, and includes a simple bug work-around (I am assuming here that the typecast needed to fix the problem is not a feature ...).
Your assumption is right: Type-casting of a procedure or function is yet another bug in GPC - which is also fixed now. You can, however, cast the *address* of a function to the type you need - *that* is a feature:
proc4 (ProcType (@pp)); (* Works *) proc3 (ProcType (@pp)); (* Should work, but doesn't; I'm on it ... *) (* okay, now it works, too. :*)
Greetings,
Peter
Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201] maintainer GNU Pascal [970714] - http://home.pages.de/~gnu-pascal/ [970125]