浏览代码

Merged revisions 1897 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

r1897 (jonas)
* fixed showing of warnings for uninitialised function results

git-svn-id: branches/fixes_2_0@1899 -

Jonas Maebe 20 年之前
父节点
当前提交
545a9188a2
共有 2 个文件被更改,包括 4 次插入3 次删除
  1. 3 2
      compiler/htypechk.pas
  2. 1 1
      compiler/symtable.pas

+ 3 - 2
compiler/htypechk.pas

@@ -775,8 +775,9 @@ implementation
                         { Give warning/note for uninitialized locals }
                         if assigned(hsym.owner) and
                            not(vo_is_external in hsym.varoptions) and
-                           (hsym.owner.symtabletype in [localsymtable,staticsymtable]) and
-                           (hsym.owner=current_procinfo.procdef.localst) then
+                           (hsym.owner.symtabletype in [parasymtable,localsymtable,staticsymtable]) and
+                           ((hsym.owner=current_procinfo.procdef.localst) or
+                            (vo_is_funcret in hsym.varoptions)) then
                           begin
                             if (vo_is_funcret in hsym.varoptions) then
                                CGMessage(sym_w_function_result_not_set)

+ 1 - 1
compiler/symtable.pas

@@ -719,7 +719,7 @@ implementation
            { also don't count the value parameters which have local copies }
            { also don't claim for high param of open parameters (PM) }
            if (Errorcount<>0) or
-              (vo_is_hidden_para in tabstractvarsym(p).varoptions) then
+              ([vo_is_hidden_para,vo_is_funcret] * tabstractvarsym(p).varoptions = [vo_is_hidden_para]) then
              exit;
            if (tstoredsym(p).refs=0) then
              begin