[fpc-pascal] ReadLn issues a warning

Yiannis Dondos dondos at otenet.gr
Sat May 14 12:52:59 CEST 2005


Hello everybody,

could you please tell me if there is something wrong with the following
code:

program test1;

var
   f: Text;
   i: Integer;
   s: ShortString;

begin
     Assign (f, 'test.dat');
     Reset (f);

     ReadLn (f, i);
     ReadLn (f, s);  // Warning: Variable not initialized

     Close (f);
end.

FPC 1.9.8 on Linux issues a warning that FPC 1.0.10 never did.
The question is why the string variable needs to be initialized?
And if it does, then why the integer variable does not issue the same
warning?

Thanks in advance,

Yannis.







More information about the fpc-pascal mailing list