Recent

Author Topic: Hint: Conversion between ordinals and pointers is not portable  (Read 3134 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 8525
Re: Hint: Conversion between ordinals and pointers is not portable
« Reply #15 on: September 12, 2022, 02:26:10 pm »
These are no functions or intrinsics, thus there are no parameters. These are type casts and a type cast has a right hand side (which is what is inside the parentheses) and a left hand side (which is the resulting type). And a Pointer can already be cast to LongWord (though you'll loose 32 bits on a 64-bit system) no intrinsics beside the type cast needed. It's just that the compiler will always issue a message in that case (a warning if the sizes don't match, a hint otherwise), because before the introduction of 64-bit systems many people used LongWord (or LongInt) and thus these people need to be made aware that something might be fishy in their code.

What would you like to call it: an implicit conversion rather than something function-like (whether or not it appeared in the RTL)?

Is there any way to find out when the compiler applies one of these, e.g. by an annotation in an assembler listing?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

PascalDragon

  • Hero Member
  • *****
  • Posts: 6272
  • Compiler Developer
Re: Hint: Conversion between ordinals and pointers is not portable
« Reply #16 on: September 13, 2022, 09:50:23 am »
What would you like to call it: an implicit conversion rather than something function-like (whether or not it appeared in the RTL)?

The official term as far as FPC is concerned is implicit type cast.

Is there any way to find out when the compiler applies one of these, e.g. by an annotation in an assembler listing?

No, there is not.

 

TinyPortal © 2005-2018