[fpc-devel] Warning: Implicit string type conversion

Paul Ishenin ip at kmiac.ru
Thu Feb 2 10:31:04 CET 2012


02.02.2012 17:00, Hans-Peter Diettrich пишет:
> I wonder how these many messages occur, even in building the libraries.
> Is it only lazyness why according fixes are missing, or are there
> reasons why such conversions are inevitable?

Compiler informs that there are places which has suspicious code. 
Probably the code there needs a review.

> Dumb question: what's the default "string" type in FPC trunk? When it's
> AnsiString, in which situations are UnicodeString conversions really
> required, in contrast to pre-UnicodeString versions?

The default string type is ShortString/AnsiString and this depends on 
{$h+/-} option. UnicodeString convertions are required when string in 
one codepage is converted to another or when ansistring is assigned to 
unicode/wide string type.

> What about WideString? E.g. fcl-xml contains a lot of WideString types -
> shouldn't these be replaced by (or retyped into) UnicodeString now? IMO
> only the Windows COM libraries require real WideString (BSTR) arguments,
> while the ordinary "W" API should be happy with pointers to UnicodeStrings.

I agree that better to review fcl-xml code and at least replace 
WideStrings with UnicodeStrings.

Best regards,
Paul Ishenin.




More information about the fpc-devel mailing list