mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-11 11:29:29 +02:00
* Reduce false positives of type_h_use_div_for_int.
git-svn-id: trunk@7590 -
This commit is contained in:
parent
4dd3be0e5a
commit
fe5118e903
@ -823,10 +823,7 @@ implementation
|
||||
begin
|
||||
left.resultdef := s64inttype;
|
||||
right.resultdef := s64inttype;
|
||||
end
|
||||
else if (left.resultdef.typ <> floatdef) and
|
||||
(right.resultdef.typ <> floatdef) then
|
||||
CGMessage(type_h_use_div_for_int);
|
||||
end;
|
||||
inserttypeconv(right,resultrealdef);
|
||||
inserttypeconv(left,resultrealdef);
|
||||
end
|
||||
|
@ -608,6 +608,11 @@ implementation
|
||||
if def=nil then
|
||||
internalerror(200103281);
|
||||
fileinfo:=node.fileinfo;
|
||||
{An attempt to convert the result of a floating point division
|
||||
(with the / operator) to an integer type will fail. Give a hint
|
||||
to use the div operator.}
|
||||
if (node.nodetype=slashn) and (def.typ=orddef) then
|
||||
cgmessage(type_h_use_div_for_int);
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user