Re: [fpc-pascal] Wrong assignment detected only run time without warning

2023-06-16 Thread Giuliano Colla via fpc-pascal
Il 16/06/23 15:02, Tomas Hajny via fpc-pascal ha scritto: If you compile with -CO, you should get at least a hint (if you enable displaying them, of course): I believed that -Co was enough. I'll add -CO to the debug options. Thanks. Giuliano ___

Re: [fpc-pascal] Wrong assignment detected only run time without warning

2023-06-16 Thread Tomas Hajny via fpc-pascal
On 2023-06-16 13:46, Giuliano Colla via fpc-pascal wrote: Il 16/06/23 13:36, Peter B via fpc-pascal ha scritto: Yes. Assigning a 64bit integer to a 32bit one is fine as long as the range is within bounds. Range of a variable can only be checked at run time. I can understand that. But the com

Re: [fpc-pascal] Wrong assignment detected only run time without warning

2023-06-16 Thread Giuliano Colla via fpc-pascal
Il 16/06/23 13:36, Peter B via fpc-pascal ha scritto: Yes. Assigning a 64bit integer to a 32bit one is fine as long as the range is within bounds. Range of a variable can only be checked at run time. I can understand that. But the compiler generates quite a number of warning for potential lo

Re: [fpc-pascal] Wrong assignment detected only run time without warning

2023-06-16 Thread Peter B via fpc-pascal
On 16/06/2023 11:55, Giuliano Colla via fpc-pascal wrote: Is that the intended behavior of compiler? Yes. Assigning a 64bit integer to a 32bit one is fine as long as the range is within bounds. Range of a variable can only be checked at run time. ___

[fpc-pascal] Wrong assignment detected only run time without warning

2023-06-16 Thread Giuliano Colla via fpc-pascal
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;