[fpc-devel] Omit hint/warning for a fixed-size array

Ondrej Pokorny lazarus at kluug.net
Thu Aug 30 09:46:47 CEST 2018


Hello,

is there a way not to get a "Variable xyz does not seem to be 
initialized" hint/warning for a fixed-size array?

program Project1;
uses Classes;
var
   Buffer: array[0..255] of Byte;
   FS: TFileStream;
begin
   // FillByte(Buffer, Length(Buffer), 0); // project1.lpr(9,18) Hint: 
Variable "Buffer" does not seem to be initialized
   FS := TFileStream.Create('test.test', fmOpenRead);
   FS.Read(Buffer[0], Length(Buffer)); // << project1.lpr(11,11) Hint: 
Variable "Buffer" does not seem to be initialized
end.

What is the correct code that doesn't emit any hint or warning?

Ondrej




More information about the fpc-devel mailing list