[fpc-devel] Error: (3069) Call by var for arg no. xx has to match exactly: Got "ShortString" expected "AnsiString"

Michael Van Canneyt michael at freepascal.org
Sun Jul 16 19:08:59 CEST 2023



On Sun, 16 Jul 2023, Maxim Ganetsky via fpc-devel wrote:

> Hello.
>
> Recent changes in FPC `main` led to the following errors when building some 
> code in Lazarus tree:
>
> Error: (3069) Call by var for arg no. xx has to match exactly: Got 
> "ShortString" expected "AnsiString"
>
> See:
>
> https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40381
>
> Note that the unit which fails to build has {$H-} directive.
>
> Is it a bug in compiler?

No. We're preparing for the unicode RTL.

Part of that was changing string -> shortstring and pchar -> ansichar.

In some rare places I changed string to ansistring in preparation of
unicodestring, in this case it was misplaced since it was a var argument. 
I added an overloaded version, which should fix the compilation error.

Michael.


More information about the fpc-devel mailing list