Delphi incompatibility of variant operations
Original Reporter info from Mantis: Gorelkin
-
Reporter name: Sergei Gorelkin
Original Reporter info from Mantis: Gorelkin
- Reporter name: Sergei Gorelkin
Description:
Certain 'integer' operations between an integer and float Variants work in Delphi (it seems to be converting floats to integers), but throw an exception in FPC:
c:>dcc32 -CC t.pp
c:>t
or: 3
and: 0
xor: 3
div: 0
mod: 1
shl: 4
shr: 0
c:>fpc -S2h t.pp
c:>t
or: Invalid variant operation Integer or Double
and: Invalid variant operation Integer and Double
xor: Invalid variant operation Integer xor Double
div: 0
mod: Invalid variant operation Integer mod Double
shl: Invalid variant operation Integer shl Double
shr: Invalid variant operation Integer shr Double
Mantis conversion info:
- Mantis ID: 11033
- Version: 2.3.1
- Fixed in version: 2.2.2
- Fixed in revision: 10787 (#283d712a)