Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2000-12

Re: Corrected, but is still a bug in Compiler: Bug 1222 continued ...

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Peter Vreman
Show quoted text 22 lines
For the others: Peter suggested that automatic typeconversions be done for cardinal constants (ie. constants in the range int64($80000000) and int64($ffffffff)) to longint because otherwise you need longint typecasts when using such constants as longints (at least when you have range checking turned on, otherwise you still get annoying warnings). A problem I see with this is that you would at least have to defferentiate between hex/binary and decimal constants, because otherwise the following would become legal (no range check error/warning) {$r+} const maxcardinal = 4294967295; var l: longint; begin l := maxcardinal; end. It is certainly possible to do such a detection, but I'm not so sure whether it's desirable...

I think we should follow delphi in such cases.