[fpc-devel] About typecasts and the documentation

Michael Van Canneyt michael at freepascal.org
Sun Feb 9 13:59:57 CET 2014



On Sat, 8 Feb 2014, Martin Frb wrote:

> On 08/02/2014 21:59, Hans-Peter Diettrich wrote:
>> 
>> Typecasts can be further restricted to *compatible* types. Here numeric 
>> types seem to be compatible with other numeric types, but not with 
>> structured types (records...).
> Well than that needs to be added to the docs.  I have no problems with it ont 
> working, I do not need it. What I do is, I do need to know what works, and 
> how. And I need to know the rule behind.

The rules behind is quite complex, so much so, that I don't care to 
explain it. I doubt the compiler devels could explain it correctly.
I also suspect it changes regularly.
Check the compiler sources if you want current behaviour.

The equal size rule comes closest. There may be some strange side-effects in
cases of ordinal types, but that is it.

Michael.



More information about the fpc-devel mailing list