On Tue, 5 Jun 2018 14:09:16 +0200
Klaus Hartnegg <hartn...@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
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to