[fpc-devel] fpc_ShortStr_To_WideStr

Alexey Barkovoy clootie at ixbt.com
Tue Mar 22 07:35:36 CET 2005


While we on theme. At least in FPC 1.9.8 there is bug in compiler: it can't 
internally convert "constant AnsiChar" to "constant WideChar".

=====================================
uses SysUtils;
const sConst =  'W';

procedure Do1(const w: PWideChar);
begin StrToInt(w); end;

begin
  Do1(sConst); //Error: Incompatible type for arg no. 1: Got "Char", expected 
"PWideChar"
  Do1('W');    //Error: Incompatible type for arg no. 1: Got "Char", expected 
"PWideChar"
  Do1('WW');   // SUCCEEDED
end.

=====================================





More information about the fpc-devel mailing list