Eike Lange wrote:
Hi Folks!
The following program compiles correctly (shouldn't there a warning?).
&<---------- (snip) ----------- program fail;
type TFoo = 2.7 .. 2.8;
var MyFoo: TFoo;
begin MyFoo := 1.0; WriteLn (MyFoo) end. &<---------- (snap) -----------
Notice, that you need spaces arround ".." to disable warning messages: "fail.pas:4: Only one decimal point in real number allowed"
My GPC version is: Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs gpc version 20010924, based on 2.95.2 19991024 (release)
That sounds like a lexical scanner failing. The real number parser should treat any second decimal point as a terminator character. Once any decimal point has been read the only non-numerics allowed should be 'e' and 'E', possibly immediately followed by '+' or '-'.
Is the same failing in the run-time? i.e. what does "read(r);" do on such inputs?