I am migrating an old project to Delphi XE and I get this warning in the code below.
function RemoveThousandSeperator(Text: String) : String; Var P : Integer; begin if length(Text) > 3 then begin p := Pos(FormatSettings.ThousandSeparator,Text); while p >0 do begin Delete(Text,p,1); p := Pos(FormatSettings.ThousandSeparator,Text); end; end; result := Text; end;
even FormatSettings.ThousandSeparator is of type char.
LE: I ask if anyone can tell me why this warning occurs. The code is old and it will be redone.
LE2: To receive this warning, all warnings must be set to true in the Delphi hint and warning compiler
LE3: If someone needs it - {$ WARN UNSAFE_CAST OFF}, the warning is turned off.
LE4: A screenshot of the warning for those who find the warning difficult to believe.

source share