Browse Source

* Limit warning to orddefs to reduce false positives.

git-svn-id: trunk@7887 -
daniel 18 years ago
parent
commit
d4280b3dec
1 changed files with 3 additions and 2 deletions
  1. 3 2
      compiler/ncnv.pas

+ 3 - 2
compiler/ncnv.pas

@@ -628,8 +628,9 @@ implementation
                cgmessage1(type_h_convert_mul_operands_to_prevent_overflow,def.gettypename);
            end;
          {Converting pointers to signed integers is a bad idea. Warn.}
-         if (node.resultdef<>nil) and (node.resultdef.typ=pointerdef) and is_signed(def) then
-            cgmessage(type_w_pointer_to_signed);
+         if (node.resultdef<>nil) and (node.resultdef.typ=pointerdef) and
+           (def.typ=orddef) and (Torddef(def).ordtype in [s8bit,s16bit,s32bit,s64bit]) then
+           cgmessage(type_w_pointer_to_signed);
       end;