Ewald schrieb:
On 28 Feb 2014, at 20:39, Jonas Maebe wrote:

All hexadecimal constants are (conceptually) parsed as int64, so
this is by design. int64($00000000ffffffff) is not -1.

By the way, what do you do when you want to port fpc to a one's
comlement machine (if they still exist)?

Numerical constants, where the sign matters, should only be encoded in decimal. The other formats (hex,oct,bin...) are intended for use with binary values, where the bit pattern is important. Then the code compiles correctly on any kind of machine.

Assumptions about type sizes and encodings can make *application* code unportable. E.g. the Extended type doesn't have a guaranteed size and binary representation, IIRC it's equivalent to Double on x64.

DoDi

_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to