I made a stupid error. My code:

  TFileObj = Class(TObject)
    [snip]
    Size: Integer;
    [snip]
    end;
....
procedure TForm1.FillDir(FileData : TSearchRec);
...
    FFIleObj.Size := FileData.Size;
...

but TSearchRec structure is:

  TRawbyteSearchRec = Record
    [snip]
    Size : Int64;
    [snip]

IOW I assign an int64 to an integer.

But when compiling I don't get any warning about that, and when the program runs there's no problem until the FileData.Size fits into an integer. When FileData.Size gets too large if compiled with -Co I get a range exception, if compiled without I just get wrong value for Size.

Is that the intended behavior of compiler?

Platform Linux CentOs 7 - fpc 3.2.2

Giuliano
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to