[fpc-pascal] fpc trunk issue with StreamIO or TMemoryStream

Luca Olivetti luca at ventoso.org
Mon Oct 7 21:13:20 CEST 2019


El 7/10/19 a les 18:29, Michael Van Canneyt ha escrit:
> 
> 
> On Mon, 7 Oct 2019, Luca Olivetti wrote:
> 
>> El 7/10/19 a les 15:18, Michael Van Canneyt ha escrit:
>>>
>>>
>>> On Mon, 7 Oct 2019, Luca Olivetti wrote:
>>>
>>>> I'm facing a strange issue, I don't know if it's StreamIO or 
>>>> TMemoryStream. The following program, compiled with fpc
>>>>
>>>> Free Pascal Compiler version 3.2.0-beta [2019/04/26] for i386
>>>>
>>>> (I checked trunk and I don't see changes in streams or streamio)
>>>
>>> I tested your program with trunk, and it works OK.
>>
>> Thank you for testing, maybe it's time to upgrade the compiler.
>> Per chance, do you know what could possibly have changed to fix the 
>> issue?
>> I'm using svn revision 41937 and I had a quick look at the changes in 
>> the repo, the only thing that caught my eyes is the ";overload;" added 
>> to the Read/Write methods of 
>> THandleStream/TCustomMemoryString/TMemoryString
> 
> Well, lots of things changed in trunk regarding stream handling (Delphi
> comapatibility) but these things were not merged to 3.2, since they require
> compiler changes, and these changes were also not merged to 3.2, since
> they're quite invasive.
> 
> The 'overload' just means that the compiler will not stop searching in the
> current class but will consider parent classes as well. This should not
> change the behaviour in case the stream variable is declared as TSTream.
> (as should be the case inside assignstream)

My bad, I'm not on trunk, I'm on the fixes_3_2 branch :-(
Sorry for the confusion.
I checked out the latest version of that branch (I'm not confident 
enough to use trunk in production) but it has the same problem.
Oh, well, I can use shortstrings in this application, though it really 
puzzles me (setting position:=0 doesn't change anything yet it causes 
this problem).

Bye
-- 
Luca


More information about the fpc-pascal mailing list