* Reduce false positives of type_h_use_div_for_int.

git-svn-id: trunk@7590 -
This commit is contained in:
daniel 2007-06-06 19:50:04 +00:00
parent 4dd3be0e5a
commit fe5118e903
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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;