[fpc-devel] {$mode tp} compatibility issue

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Jun 5 14:59:55 CEST 2018


On Tue, 5 Jun 2018 14:09:16 +0200
Klaus Hartnegg <hartnegg at gmx.de> wrote:

> Hi,
> 
> I just stepped into a trap when compiling Turbo Pascal source with 
> FreePascal, and wonder how FreePascal could prevent this.
> 
> The source effectively contains something like
> 
> type
>    mytype = (a,b,c);
> 
> var
>    t : mytype;
>    f : text;
> 
> begin
>    assign (f,'filename');
>    reset (f);
>    readln (f,byte(t));
> 
> Except that in the real thing the type declaration was in another unit,
> but that should not matter, right?

It does matter. See here:
https://www.freepascal.org/docs-html/prog/progsu59.html#x66-650001.2.59

Mattias



More information about the fpc-devel mailing list