[fpc-devel] TRegistry and Unicode

Michael Van Canneyt michael at freepascal.org
Wed Mar 6 18:28:45 CET 2019



On Wed, 6 Mar 2019, Bart wrote:

> On Wed, Mar 6, 2019 at 4:10 PM Michael Van Canneyt
> <michael at freepascal.org> wrote:
>
>
>> So, what do you propose for maximum backwards compatibility ?
>>
>> By this I mean, for people that basically use plain strings and ASCII, they
>> should not get warnings about
>> 'conversion from widestring to ansistring' and vice versa.
>
> I see.
> If I have in unit registry:
>
> procedure TRegistry.A(S: String);
> var
>  u: UnicodeString;
> begin
>   u := S;
>   A(u);
> end;
>
> procedure TRegistry.A(U: UniCodeString);
> begin
>  ...
> end;
>
> and then in my program:
>
> var
>  S: String;
>  R: TRegistry;
> ..
>  R.A(S);
>
> And given that the procedures A are part of fpc distribution, and the
> path to the source is NOT in your search path for the compiler (i.o.w.
> just a regular fpc user, not someone who builds fpc) then the end-user
> (the programmer) would not see that warning if I'm correct?

Yes.


>
> When building fpc I get tons of conversion warnings that I don't get
> when I simply build my program.

Ideally, they should all be fixed. They are all potential sources of error.

Michael.



More information about the fpc-devel mailing list