[fpc-devel] c-blocks (darwin aarch64)
Jonas Maebe
jonas.maebe at elis.ugent.be
Mon Apr 18 10:18:39 CEST 2016
Dmitry Boyarintsev wrote:
> Regarding the fix on 30022. I'd think the behavior is Delphi compatible,
> where it would also complain passing a function (block) with address
> operator.
Delphi does not support assigning procedures to variables representing
anonymous functions, so I doubt they would allow it for C-blocks.
> It's just a bit surprising, since it's inconsistent with regular
> procedure type variables.
It's the same as with procedure of object, also in Delphi. The fact that
Type X (pointer) can be automatically converted to Type Y (procvar),
does not mean that Type X can also be automatically converted to type Z
(C-block).
In fact, it is plain bad to let (data) pointers be automatically
converted into procvars and vice versa, because on some platforms (such
as PowerPC64 ELFv1, and also MS-DOS in most memory models) they are
quite different. We "solve" this by also returning a procvar for
@procname on such platforms (or by introducing multiple pointer types
like for MS-DOS), but that in turn requires workarounds like in r20820.
Jonas
More information about the fpc-devel
mailing list