Compatibility problems with fpc > 3.3.1 rev 42375

classic Classic list List threaded Threaded
27 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Compatibility problems with fpc > 3.3.1 rev 42375

fredvs
Hello Sven.

> I can't see any difference in that procedure to the one in Classes.TReader
> except for the ifdefs and a few extensions for events and UTF-8 strings,
> so the problem must be somewhere else.

Ha, we are going forward. so maybe TReader is not the problem.

Ok, I will try to investigate a different way.

Thanks Sven.

Fre;D

PS: If you see some other things that could be the guilty, dont hesitate to
say it.









-----
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compatibility problems with fpc > 3.3.1 rev 42375

fredvs
Hello.

Great news!

With last fpc commits, msegui is fpc compatible again!

(And I am very curious what was the problem, if you can explain what you did
it would be super.)

Anyway, perfect and many thanks.

Fre;D




-----
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compatibility problems with fpc > 3.3.1 rev 42375

fredvs
Oops, sorry, fake news.



It was my mistake, I did compile with fpc 3.0.4.

So, no, with last commits, it does not fix the problems.

Fre;D



-----
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compatibility problems with fpc > 3.3.1 rev 42375

Free Pascal - General mailing list
Hello everybody.

Good time to go back with that problem and fix it forever the right way!
The problem is isolated and is fixed "hardcoded".

From rev 42375, in msegui function dynarrayelesize(const typinfo:
pdynarraytypeinfo): sizeint; inline;
the result is always = 0.

This function is used in additempo() function, used mainly in the
msestat.pas file.
This is used to restore, for example, the position and size of windows.

To fix with a turn-around, I did first compile mseide with fpc 3.2.0 to know
what is the value of dynarrayelesize(typeinfo).
It is always 16 and then I use that constant instead of
dynarrayelesize(typeinfo).

It works like charm and can use now fpc 3.3.1 without problems.

Great but, for the Champions, would it be somebody that can explain why the
result is always = 0 from rev 42375 ?

Here the problematic function:

function dynarrayelesize(const typinfo: pdynarraytypeinfo): sizeint; inline;
var
 ti: pdynarraytypeinfo;
begin
 ti:= typinfo;
{$ifdef FPC}
 inc(pointer(ti),ord(pdynarraytypeinfo(ti)^.namelen)+2);
 ti:= aligntoptr(ti);
 result:= psizeint(ti)^;
{$else}
 inc(pchar(ti),length(ti^.name));
 result:= ti^.elsize;
{$endif}
end;




-----
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compatibility problems with fpc > 3.3.1 rev 42375

Martin Frb
On 02/02/2020 04:22, fredvs via fpc-pascal wrote:
> Hello everybody.
>
> Good time to go back with that problem and fix it forever the right way!
> The problem is isolated and is fixed "hardcoded".
>
>  From rev 42375, in msegui function dynarrayelesize(const typinfo:
> pdynarraytypeinfo): sizeint; inline;
> the result is always = 0.
>

I do not know if fpc has an official way to get the size of an array
element from the typeinfo.

But comparing the internals:
{$ifdef VER3_0}
       typeInfo:=aligntoptr(typeInfo+2+PByte(typeInfo)[1]);
{$else VER3_0}
       typeInfo:=aligntoqword(typeInfo+2+PByte(typeInfo)[1]);
{$endif VER3_0}

So alignment changed, which is why the old code no longer works

mse always does

  ti:= aligntoptr(ti);

_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compatibility problems with fpc > 3.3.1 rev 42375

Free Pascal - General mailing list
Hello Martin.

Wow.

Indeed, I did a check in mse code and only exists, in msearrayutils.pas:

function aligntoptr(p: pointer): pointer; inline;
begin
{$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
 result:= align(p,sizeof(p));
{$else FPC_REQUIRES_PROPER_ALIGNMENT}
 result:=p;
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
end;

And nothing about aligntoqword()

I dont know if a function aligntoqword(p: pointer): pointer; inline;
must be added in msearrayutils.pas.

I will try using aligntoqword() of fpc and adapting mse code for it (ti:=
aligntoqword(ti);

If you see a other way, please advice.

Many, many, many thanks.

Fre;D

 



-----
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Compatibility problems with fpc > 3.3.1 rev 42375

Free Pascal - General mailing list
Hello.

I did try using aligntoqword() but without luck, I only get crash at
loading.

It is very sad but I dont have the skill to fix this and mse depends of a
guru with brave heart to make it compatible with fpc 3.3.1.

Anyway, many thanks Martin for your light.

Fre;D



-----
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
12