No type casting real types to ordinals?
Original Reporter info from Mantis: FPCCore
-
Reporter name: FPC core team
Original Reporter info from Mantis: FPCCore
- Reporter name: FPC core team
Description:
Version 1.0.5 of the compiler (and possibly 1.1.x, haven't looked at it) doesn't seem to support real to integer type casting, neither implicit nor explicit. I attemped to patch the problem, but ran into many problems in the type checking and implicit casting for overloaded procedures and operators. Adding in support for this may mean a slight rewrite of this and related units. Of course, the Round and Trunc RTL functions allow this conversion explicitly. However, these functions are disadvantegeous due to their overhead of a call/ret, stack frame setup/cleanup, and floating-point control word setup (on the i386). With most C/C++ compilers, library functions are provided to control the behaviour of floating-point -> integer conversions by manipulating the fpu control word, then this conversion can be inlined with no extra overhead. Perhaps this should be investigated... just some thoughts!
Additional information:
Reporter: Jesse Towner
EMail: jesse at ideasoftware dot com
Mantis conversion info:
- Mantis ID: 3760
- OS: WIN32
- Version: 1.0.5
- Fixed in version: N/A