Spurious warnings
Original Reporter info from Mantis: Phil
-
Reporter name:
Original Reporter info from Mantis: Phil
- Reporter name:
Description:
FPC 2.1.1 generates spurious "type size mismatch" warnings for some arithmetic expressions. FPC 2.0.2 and Delphi 7 do not generate these warnings.
Example:
program TestMismatch;
type
TTestClass = class(TObject)
public
procedure AProc(AValue : Single);
end;
procedure TTestClass.AProc(AValue : Single);
begin
WriteLn(AValue);
end;
var
AnObj : TTestClass;
ASingle : Single;
begin
AnObj := TTestClass.Create;
ASingle := 1;
AnObj.AProc(ASingle * 2); //Does not generate warning
AnObj.AProc(ASingle * 2.0); //Generates warning with -Cr or -vh
end.
Mantis conversion info:
- Mantis ID: 7179
- OS: Windows XP
- OS Build: SP2
- Build: 20070718
- Platform: Intel
- Version: 2.2.0
- Fixed in version: 2.2.0
- Fixed in revision: 5927 (#e815b923)