2
0
Эх сурвалжийг харах

* delay verbosity changes just like localswitches changes
* store a node's verbosity in the node so that e.g. disabling warnings
also disables warnings for this node in pass_1
(the above together fix mantis #12076)
* save/restore verbosity with {$push}/{$pop} (mantis #12075)
* if warnings/notes/hints are turned off, also do not count encountered
ones for the totals (otherwise -Sew cannot be used properly in
combination with {$warnings off}, because disabled warnings will still
trigger a compiler error) -- this required adding -vw/-vn/-vh to all
tests using -Sew/-Sen/-Seh
- removed some superfluous state saving/restoring from firstpass()

git-svn-id: trunk@12025 -

Jonas Maebe 16 жил өмнө
parent
commit
e5920bc2b8
100 өөрчлөгдсөн 265 нэмэгдсэн , 192 устгасан
  1. 2 0
      .gitattributes
  2. 10 3
      compiler/globals.pas
  3. 6 1
      compiler/node.pas
  4. 2 6
      compiler/parser.pas
  5. 9 7
      compiler/pass_1.pas
  6. 1 1
      compiler/ppu.pas
  7. 22 47
      compiler/scandir.pas
  8. 3 15
      compiler/scanner.pas
  9. 72 11
      compiler/switches.pas
  10. 15 12
      compiler/verbose.pas
  11. 1 1
      tests/tbf/tb0074.pp
  12. 1 1
      tests/tbf/tb0180.pp
  13. 1 1
      tests/tbf/tb0182.pp
  14. 1 1
      tests/tbf/tb0183.pp
  15. 1 1
      tests/tbf/tb0193.pp
  16. 1 1
      tests/tbf/tb0195.pp
  17. 1 1
      tests/tbf/tb0196.pp
  18. 1 1
      tests/tbf/tb0197.pp
  19. 1 1
      tests/tbf/tb0207.pp
  20. 1 1
      tests/tbf/tb0208.pp
  21. 1 1
      tests/tbs/tb0271.pp
  22. 1 1
      tests/tbs/tb0287.pp
  23. 1 1
      tests/tbs/tb0376.pp
  24. 1 1
      tests/tbs/tb0500.pp
  25. 1 1
      tests/tbs/tb0501.pp
  26. 1 1
      tests/tbs/tb0502.pp
  27. 1 1
      tests/tbs/tb0504.pp
  28. 1 1
      tests/tbs/tb0522.pp
  29. 1 1
      tests/tbs/tb0525.pp
  30. 1 1
      tests/tbs/tb0534.pp
  31. 1 1
      tests/tbs/tb0542.pp
  32. 1 1
      tests/test/cg/tcnvptr.pp
  33. 1 1
      tests/test/tfwork2.pp
  34. 1 1
      tests/test/tmainnam.pp
  35. 1 1
      tests/webtbf/tw0769b.pp
  36. 1 1
      tests/webtbf/tw0769c.pp
  37. 1 1
      tests/webtbf/tw10833a.pp
  38. 1 1
      tests/webtbf/tw10849.pp
  39. 1 1
      tests/webtbf/tw11846.pp
  40. 1 1
      tests/webtbf/tw11846c.pp
  41. 1 1
      tests/webtbf/tw11848a.pp
  42. 1 1
      tests/webtbf/tw11849a.pp
  43. 18 0
      tests/webtbf/tw12075.pp
  44. 1 1
      tests/webtbf/tw2209.pp
  45. 1 1
      tests/webtbf/tw2752.pp
  46. 1 1
      tests/webtbf/tw3553.pp
  47. 1 1
      tests/webtbf/tw3562.pp
  48. 1 1
      tests/webtbf/tw3631.pp
  49. 1 1
      tests/webtbf/tw3643.pp
  50. 1 1
      tests/webtbf/tw4139.pp
  51. 1 1
      tests/webtbf/tw4737.pp
  52. 1 1
      tests/webtbf/tw8151b.pp
  53. 1 1
      tests/webtbf/tw8151c.pp
  54. 1 1
      tests/webtbf/tw8264a.pp
  55. 1 1
      tests/webtbs/tw0769.pp
  56. 1 1
      tests/webtbs/tw10736.pp
  57. 1 1
      tests/webtbs/tw10931.pp
  58. 2 2
      tests/webtbs/tw11846a.pp
  59. 1 1
      tests/webtbs/tw11846b.pp
  60. 1 1
      tests/webtbs/tw11848.pp
  61. 1 1
      tests/webtbs/tw11849.pp
  62. 1 1
      tests/webtbs/tw12050a.pp
  63. 1 1
      tests/webtbs/tw12050b.pp
  64. 16 0
      tests/webtbs/tw12076.pp
  65. 1 1
      tests/webtbs/tw12508a.pp
  66. 1 1
      tests/webtbs/tw1851.pp
  67. 1 1
      tests/webtbs/tw1948.pp
  68. 1 1
      tests/webtbs/tw2307.pp
  69. 1 1
      tests/webtbs/tw2425.pp
  70. 1 1
      tests/webtbs/tw2435.pp
  71. 1 1
      tests/webtbs/tw2438.pp
  72. 1 1
      tests/webtbs/tw2710.pp
  73. 1 1
      tests/webtbs/tw2789.pp
  74. 1 1
      tests/webtbs/tw2815.pp
  75. 1 1
      tests/webtbs/tw2817.pp
  76. 1 1
      tests/webtbs/tw2832.pp
  77. 1 1
      tests/webtbs/tw2841.pp
  78. 1 1
      tests/webtbs/tw3172.pp
  79. 1 1
      tests/webtbs/tw3281.pp
  80. 1 1
      tests/webtbs/tw3364.pp
  81. 1 1
      tests/webtbs/tw3490.pp
  82. 1 1
      tests/webtbs/tw3567.pp
  83. 1 1
      tests/webtbs/tw3669.pp
  84. 1 1
      tests/webtbs/tw3952.pp
  85. 1 1
      tests/webtbs/tw3970.pp
  86. 1 1
      tests/webtbs/tw4006.pp
  87. 1 1
      tests/webtbs/tw4043.pp
  88. 1 1
      tests/webtbs/tw4068.pp
  89. 1 1
      tests/webtbs/tw4330.pp
  90. 1 1
      tests/webtbs/tw4332.pp
  91. 1 1
      tests/webtbs/tw4954.pp
  92. 1 1
      tests/webtbs/tw5100.pp
  93. 1 1
      tests/webtbs/tw5100a.pp
  94. 1 1
      tests/webtbs/tw7179.pp
  95. 1 1
      tests/webtbs/tw7285.pp
  96. 1 1
      tests/webtbs/tw7808.pp
  97. 1 1
      tests/webtbs/tw8090.pp
  98. 1 1
      tests/webtbs/tw8151a.pp
  99. 1 1
      tests/webtbs/tw8264.pp
  100. 1 1
      tests/webtbs/tw8282.pp

+ 2 - 0
.gitattributes

@@ -8131,6 +8131,7 @@ tests/webtbf/tw11848a.pp svneol=native#text/plain
 tests/webtbf/tw11849a.pp svneol=native#text/plain
 tests/webtbf/tw11862a.pp svneol=native#text/plain
 tests/webtbf/tw11970.pp svneol=native#text/plain
+tests/webtbf/tw12075.pp svneol=native#text/plain
 tests/webtbf/tw12329.pp svneol=native#text/plain
 tests/webtbf/tw12365a.cfg svneol=native#text/plain
 tests/webtbf/tw12365a.pp svneol=native#text/plain
@@ -8593,6 +8594,7 @@ tests/webtbs/tw12050a.pp svneol=native#text/plain
 tests/webtbs/tw12050b.pp svneol=native#text/plain
 tests/webtbs/tw12051.pp svneol=native#text/plain
 tests/webtbs/tw1207.pp svneol=native#text/plain
+tests/webtbs/tw12076.pp svneol=native#text/plain
 tests/webtbs/tw12186.pp svneol=native#text/plain
 tests/webtbs/tw12202.pp svneol=native#text/plain
 tests/webtbs/tw12214.pp svneol=native#text/plain

+ 10 - 3
compiler/globals.pas

@@ -161,6 +161,15 @@ interface
         property items[I:longint]:TLinkRec read getlinkrec; default;
       end;
 
+      tpendingstate = record
+        nextverbositystr : string;
+        nextlocalswitches : tlocalswitches;
+        nextverbosityfullswitch: longint;
+        verbosityfullswitched,
+        localswitcheschanged : boolean;
+      end;
+
+
     var
        { specified inputfile }
        inputfilepath     : string;
@@ -252,9 +261,7 @@ interface
        init_settings,
        current_settings   : tsettings;
 
-       nextlocalswitches : tlocalswitches;
-       localswitcheschanged : boolean;
-
+       pendingstate       : tpendingstate;
      { Memory sizes }
        heapsize,
        stacksize,

+ 6 - 1
compiler/node.pas

@@ -298,6 +298,7 @@ interface
          resultdefderef : tderef;
          fileinfo      : tfileposinfo;
          localswitches : tlocalswitches;
+         verbosity     : longint;
          optinfo : poptinfo;
          constructor create(t:tnodetype);
          { this constructor is only for creating copies of class }
@@ -466,7 +467,7 @@ interface
 implementation
 
     uses
-       cutils,verbose,ppu,
+       cutils,verbose,ppu,comphook,
        symconst,
        nutils,nflw,
        defutil;
@@ -695,6 +696,7 @@ implementation
          { save local info }
          fileinfo:=current_filepos;
          localswitches:=current_settings.localswitches;
+         verbosity:=status.verbosity;
          resultdef:=nil;
          flags:=[];
       end;
@@ -712,6 +714,7 @@ implementation
         blocktype:=tblock_type(ppufile.getbyte);
         ppufile.getposinfo(fileinfo);
         ppufile.getsmallset(localswitches);
+        verbosity:=ppufile.getlongint;
         ppufile.getderef(resultdefderef);
         ppufile.getsmallset(flags);
         { updated by firstpass }
@@ -726,6 +729,7 @@ implementation
         ppufile.putbyte(byte(block_type));
         ppufile.putposinfo(fileinfo);
         ppufile.putsmallset(localswitches);
+        ppufile.putlongint(verbosity);
         ppufile.putderef(resultdefderef);
         ppufile.putsmallset(flags);
       end;
@@ -887,6 +891,7 @@ implementation
          p.resultdef:=resultdef;
          p.fileinfo:=fileinfo;
          p.localswitches:=localswitches;
+         p.verbosity:=verbosity;
 {         p.list:=list; }
          result:=p;
       end;

+ 2 - 6
compiler/parser.pas

@@ -41,7 +41,7 @@ implementation
       fksysutl,
 {$ENDIF}
       cutils,cclasses,
-      globtype,version,tokens,systems,globals,verbose,
+      globtype,version,tokens,systems,globals,verbose,switches,
       symbase,symtable,symsym,
       finput,fmodule,fppu,
       aasmbase,aasmtai,aasmdata,
@@ -309,11 +309,7 @@ implementation
             oldparse_only:=parse_only;
           { save akt... state }
           { handle the postponed case first }
-           if localswitcheschanged then
-             begin
-               current_settings.localswitches:=nextlocalswitches;
-               localswitcheschanged:=false;
-             end;
+            flushpendingswitchesstate;
             oldcurrent_filepos:=current_filepos;
             old_settings:=current_settings;
           end;

+ 9 - 7
compiler/pass_1.pas

@@ -41,7 +41,7 @@ interface
 implementation
 
     uses
-      globtype,systems,cclasses,
+      globtype,comphook,systems,cclasses,
       cutils,globals,
       procinfo,
       cgbase,symdef
@@ -61,6 +61,7 @@ implementation
       var
          oldcodegenerror  : boolean;
          oldlocalswitches : tlocalswitches;
+         oldverbosity     : longint;
          oldpos    : tfileposinfo;
          hp        : tnode;
       begin
@@ -69,9 +70,11 @@ implementation
            oldcodegenerror:=codegenerror;
            oldpos:=current_filepos;
            oldlocalswitches:=current_settings.localswitches;
+           oldverbosity:=status.verbosity;
            codegenerror:=false;
            current_filepos:=p.fileinfo;
            current_settings.localswitches:=p.localswitches;
+           status.verbosity:=p.verbosity;
            hp:=p.pass_typecheck;
            { should the node be replaced? }
            if assigned(hp) then
@@ -84,6 +87,7 @@ implementation
             end;
            current_settings.localswitches:=oldlocalswitches;
            current_filepos:=oldpos;
+           status.verbosity:=oldverbosity;
            if codegenerror then
             begin
               include(p.flags,nf_error);
@@ -115,6 +119,7 @@ implementation
          oldcodegenerror  : boolean;
          oldlocalswitches : tlocalswitches;
          oldpos    : tfileposinfo;
+         oldverbosity: longint;
          hp : tnode;
       begin
          if (nf_pass1_done in p.flags) then
@@ -124,17 +129,17 @@ implementation
               oldcodegenerror:=codegenerror;
               oldpos:=current_filepos;
               oldlocalswitches:=current_settings.localswitches;
+              oldverbosity:=status.verbosity;
               codegenerror:=false;
               current_filepos:=p.fileinfo;
               current_settings.localswitches:=p.localswitches;
+              status.verbosity:=p.verbosity;
               { checks make always a call }
               if ([cs_check_range,cs_check_overflow,cs_check_stack] * current_settings.localswitches <> []) then
                 include(current_procinfo.flags,pi_do_call);
               { determine the resultdef if not done }
               if (p.resultdef=nil) then
                begin
-                 current_filepos:=p.fileinfo;
-                 current_settings.localswitches:=p.localswitches;
                  hp:=p.pass_typecheck;
                  { should the node be replaced? }
                  if assigned(hp) then
@@ -152,15 +157,11 @@ implementation
                     if p.resultdef=nil then
                      p.resultdef:=generrordef;
                   end;
-                 current_settings.localswitches:=oldlocalswitches;
-                 current_filepos:=oldpos;
                  codegenerror:=codegenerror or oldcodegenerror;
                end;
               if not(nf_error in p.flags) then
                begin
                  { first pass }
-                 current_filepos:=p.fileinfo;
-                 current_settings.localswitches:=p.localswitches;
                  hp:=p.pass_1;
                  { should the node be replaced? }
                  if assigned(hp) then
@@ -197,6 +198,7 @@ implementation
               codegenerror:=codegenerror or oldcodegenerror;
               current_settings.localswitches:=oldlocalswitches;
               current_filepos:=oldpos;
+              status.verbosity:=oldverbosity;
            end
          else
            codegenerror:=true;

+ 1 - 1
compiler/ppu.pas

@@ -43,7 +43,7 @@ type
 {$endif Test_Double_checksum}
 
 const
-  CurrentPPUVersion = 92;
+  CurrentPPUVersion = 93;
 
 { buffer sizes }
   maxentrysize = 1024;

+ 22 - 47
compiler/scandir.pas

@@ -41,11 +41,17 @@ implementation
       rabase;
 
     const
-      localswitchesstackmax = 20;
+      switchesstatestackmax = 20;
+
+    type
+      tsavedswitchesstate = record
+        localsw: tlocalswitches;
+        verbosity: longint;
+      end;
 
     var
-      localswitchesstack: array[0..localswitchesstackmax] of tlocalswitches;
-      localswitchesstackpos: Integer;
+      switchesstatestack: array[0..switchesstatestackmax] of tsavedswitchesstate;
+      switchesstatestackpos: Integer;
 
 {*****************************************************************************
                                     Helpers
@@ -68,7 +74,7 @@ implementation
       begin
       { support ON/OFF }
         state:=current_scanner.ReadState;
-        SetVerbosity(flag+state);
+        recordpendingverbosityswitch(flag,state);
       end;
 
 
@@ -93,15 +99,7 @@ implementation
       begin
         state:=current_scanner.readstate;
         if (sw<>cs_localnone) and (state in ['-','+']) then
-         begin
-           if not localswitcheschanged then
-             nextlocalswitches:=current_settings.localswitches;
-           if state='-' then
-            exclude(nextlocalswitches,sw)
-           else
-            include(nextlocalswitches,sw);
-           localswitcheschanged:=true;
-         end;
+          recordpendinglocalswitch(sw,state);
       end;
 
     procedure do_localswitchdefault(sw:tlocalswitch);
@@ -110,23 +108,7 @@ implementation
       begin
         state:=current_scanner.readstatedefault;
         if (sw<>cs_localnone) and (state in ['-','+','*']) then
-         begin
-           if not localswitcheschanged then
-             nextlocalswitches:=current_settings.localswitches;
-           if state='-' then
-            exclude(nextlocalswitches,sw)
-           else
-            if state='+' then
-             include(nextlocalswitches,sw)
-            else
-             begin
-              if sw in init_settings.localswitches then
-               include(nextlocalswitches,sw)
-              else
-               exclude(nextlocalswitches,sw);
-             end;
-           localswitcheschanged:=true;
-         end;
+          recordpendinglocalswitch(sw,state);
       end;
 
 
@@ -945,16 +927,12 @@ implementation
     procedure dir_pop;
 
     begin
-      if localswitchesstackpos < 1 then
+      if switchesstatestackpos < 1 then
         Message(scan_e_too_many_pop);
 
-      if not localswitcheschanged then
-        nextlocalswitches:=current_settings.localswitches;
-
-      Dec(localswitchesstackpos);
-      nextlocalswitches:= localswitchesstack[localswitchesstackpos];
-
-      localswitcheschanged:=true;
+      Dec(switchesstatestackpos);
+      recordpendinglocalfullswitch(switchesstatestack[switchesstatestackpos].localsw);
+      recordpendingverbosityfullswitch(switchesstatestack[switchesstatestackpos].verbosity);
     end;
 
     procedure dir_profile;
@@ -970,17 +948,14 @@ implementation
     procedure dir_push;
 
     begin
-      if localswitchesstackpos > localswitchesstackmax then
+      if switchesstatestackpos > switchesstatestackmax then
         Message(scan_e_too_many_push);
 
-      if localswitcheschanged then
-        begin
-          current_settings.localswitches:=nextlocalswitches;
-          localswitcheschanged:=false;
-        end;
+      flushpendingswitchesstate;
 
-      localswitchesstack[localswitchesstackpos]:= current_settings.localswitches;
-      Inc(localswitchesstackpos);
+      switchesstatestack[switchesstatestackpos].localsw:= current_settings.localswitches;
+      switchesstatestack[switchesstatestackpos].verbosity:=status.verbosity;
+      Inc(switchesstatestackpos);
     end;
 
     procedure dir_rangechecks;
@@ -1434,5 +1409,5 @@ implementation
       end;
 
 begin
-  localswitchesstackpos:= 0;
+  switchesstatestackpos:= 0;
 end.

+ 3 - 15
compiler/scanner.pas

@@ -332,11 +332,7 @@ implementation
         if b then
          begin
            { resolve all postponed switch changes }
-           if localswitcheschanged then
-             begin
-               current_settings.localswitches:=nextlocalswitches;
-               localswitcheschanged:=false;
-             end;
+           flushpendingswitchesstate;
 
            HandleModeSwitches(changeinit);
 
@@ -526,11 +522,7 @@ implementation
 
     procedure dir_ifopt;
       begin
-        if localswitcheschanged then
-          begin
-            current_settings.localswitches:=nextlocalswitches;
-            localswitcheschanged:=false;
-          end;
+        flushpendingswitchesstate;
         current_scanner.ifpreprocstack(pp_ifopt,@opt_check,scan_c_ifopt_found);
       end;
 
@@ -3200,11 +3192,7 @@ In case not, the value returned can be arbitrary.
       label
          exit_label;
       begin
-        if localswitcheschanged then
-          begin
-            current_settings.localswitches:=nextlocalswitches;
-            localswitcheschanged:=false;
-          end;
+        flushpendingswitchesstate;
 
         { record tokens? }
         if allowrecordtoken and

+ 72 - 11
compiler/switches.pas

@@ -25,14 +25,23 @@ unit switches;
 
 interface
 
+uses
+  globtype;
+
 procedure HandleSwitch(switch,state:char);
 function CheckSwitch(switch,state:char):boolean;
 
+procedure recordpendingverbosityswitch(sw: char; state: char);
+procedure recordpendinglocalswitch(sw: tlocalswitch; state: char);
+procedure recordpendinglocalfullswitch(const switches: tlocalswitches);
+procedure recordpendingverbosityfullswitch(verbosity: longint);
+procedure flushpendingswitchesstate;
 
 implementation
 uses
-  globtype,systems,cpuinfo,
-  globals,verbose,fmodule;
+  systems,cpuinfo,
+  globals,verbose,comphook,
+  fmodule;
 
 {****************************************************************************
                           Main Switches Parsing
@@ -149,15 +158,7 @@ begin
        unsupportedsw :
          Message1(scan_w_unsupported_switch,'$'+switch);
        localsw :
-         begin
-           if not localswitcheschanged then
-             nextlocalswitches:=current_settings.localswitches;
-           if state='+' then
-            include(nextlocalswitches,tlocalswitch(setsw))
-           else
-            exclude(nextlocalswitches,tlocalswitch(setsw));
-           localswitcheschanged:=true;
-         end;
+         recordpendinglocalswitch(tlocalswitch(setsw),state);
        modulesw :
          begin
            if current_module.in_global then
@@ -256,4 +257,64 @@ begin
 end;
 
 
+procedure recordpendingverbosityswitch(sw: char; state: char);
+  begin
+    pendingstate.nextverbositystr:=pendingstate.nextverbositystr+sw+state;
+  end;
+
+
+procedure recordpendinglocalswitch(sw: tlocalswitch; state: char);
+  begin
+    if not pendingstate.localswitcheschanged then
+       pendingstate.nextlocalswitches:=current_settings.localswitches;
+    if state='-' then
+      exclude(pendingstate.nextlocalswitches,sw)
+    else if state='+' then
+      include(pendingstate.nextlocalswitches,sw)
+    else { state = '*' }
+      begin
+        if sw in init_settings.localswitches then
+         include(pendingstate.nextlocalswitches,sw)
+        else
+         exclude(pendingstate.nextlocalswitches,sw);
+      end;
+    pendingstate.localswitcheschanged:=true;
+  end;
+
+
+procedure recordpendinglocalfullswitch(const switches: tlocalswitches);
+  begin
+    pendingstate.nextlocalswitches:=switches;
+    pendingstate.localswitcheschanged:=true;
+  end;
+
+
+procedure recordpendingverbosityfullswitch(verbosity: longint);
+  begin
+    pendingstate.nextverbositystr:='';
+    pendingstate.nextverbosityfullswitch:=verbosity;
+    pendingstate.verbosityfullswitched:=true;
+  end;
+
+
+procedure flushpendingswitchesstate;
+  begin
+    if pendingstate.localswitcheschanged then
+      begin
+        current_settings.localswitches:=pendingstate.nextlocalswitches;
+        pendingstate.localswitcheschanged:=false;
+      end;
+    if pendingstate.verbosityfullswitched then
+      begin
+        status.verbosity:=pendingstate.nextverbosityfullswitch;
+        pendingstate.verbosityfullswitched:=false;
+      end;
+    if pendingstate.nextverbositystr<>'' then
+      begin
+        setverbosity(pendingstate.nextverbositystr);
+        pendingstate.nextverbositystr:='';
+      end;
+  end;
+
+
 end.

+ 15 - 12
compiler/verbose.pas

@@ -579,26 +579,29 @@ implementation
                 'W':
                   begin
                     v:=v or V_Warning;
-                    if status.errorwarning then
-                     inc(status.errorcount)
-                    else
-                     inc(status.countWarnings);
+                    if CheckVerbosity(V_Warning) then
+                      if status.errorwarning then
+                       inc(status.errorcount)
+                      else
+                       inc(status.countWarnings);
                   end;
                 'N' :
                   begin
                     v:=v or V_Note;
-                    if status.errornote then
-                     inc(status.errorcount)
-                    else
-                     inc(status.countNotes);
+                    if CheckVerbosity(V_Note) then
+                      if status.errornote then
+                       inc(status.errorcount)
+                      else
+                       inc(status.countNotes);
                   end;
                 'H' :
                   begin
                     v:=v or V_Hint;
-                    if status.errorhint then
-                     inc(status.errorcount)
-                    else
-                     inc(status.countHints);
+                    if CheckVerbosity(V_Hint) then
+                      if status.errorhint then
+                       inc(status.errorcount)
+                      else
+                       inc(status.countHints);
                   end;
                 'I' :
                   v:=v or V_Info;

+ 1 - 1
tests/tbf/tb0074.pp

@@ -1,5 +1,5 @@
 { %FAIL }
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 
 { Old file: tbf0351.pp }
 

+ 1 - 1
tests/tbf/tb0180.pp

@@ -1,5 +1,5 @@
 { %fail }
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 {$calling }
 
 begin

+ 1 - 1
tests/tbf/tb0182.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 { %fail }
 
 {$T-}

+ 1 - 1
tests/tbf/tb0183.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 { %fail }
 
 {$T-}

+ 1 - 1
tests/tbf/tb0193.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 { %fail }
 
 {$ifdef fpc}

+ 1 - 1
tests/tbf/tb0195.pp

@@ -1,5 +1,5 @@
 { %fail }
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 var
   a: longint;

+ 1 - 1
tests/tbf/tb0196.pp

@@ -1,6 +1,6 @@
 { %norun }
 { %fail }
-{ %opt=-Sen }
+{ %opt=-Sen -vn }
 
 type
  tr = record

+ 1 - 1
tests/tbf/tb0197.pp

@@ -1,6 +1,6 @@
 { %norun }
 { %fail }
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 type
  tr = record

+ 1 - 1
tests/tbf/tb0207.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 { %fail }
 {$mode objfpc}
 procedure p(out o);

+ 1 - 1
tests/tbf/tb0208.pp

@@ -1,5 +1,5 @@
 { %fail }
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 procedure test;
 var

+ 1 - 1
tests/tbs/tb0271.pp

@@ -1,4 +1,4 @@
-{ %OPT= -Sen }
+{ %OPT= -Sen -vn }
 
 { Old file: tbs0317.pp }
 

+ 1 - 1
tests/tbs/tb0287.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sen }
+{ %OPT=-Sen -vn }
 
 { Old file: tbs0339.pp }
 

+ 1 - 1
tests/tbs/tb0376.pp

@@ -1,4 +1,4 @@
-{%OPT=-Sew}
+{%OPT=-Sew -vw}
 {$mode objfpc}
 
 function f: longint;

+ 1 - 1
tests/tbs/tb0500.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Seh }
+{ %OPT=-Seh -vh }
 program test;
 uses math;
 

+ 1 - 1
tests/tbs/tb0501.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sen }
+{ %OPT=-Sen -vn }
 
 {$mode objfpc}
 

+ 1 - 1
tests/tbs/tb0502.pp

@@ -1,5 +1,5 @@
 { %norun }
-{ %opt=-Sen }
+{ %opt=-Sen -vn }
 type
       TRegister = (
         TRegisterLowEnum := Low(longint),

+ 1 - 1
tests/tbs/tb0504.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 
 {$T-}
 

+ 1 - 1
tests/tbs/tb0522.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 {$ifdef fpc}
 {$mode delphi}

+ 1 - 1
tests/tbs/tb0525.pp

@@ -1,5 +1,5 @@
 { %norun }
-{ %opt=-Sen }
+{ %opt=-Sen -vn }
 
 type
  tr = record

+ 1 - 1
tests/tbs/tb0534.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 {$mode objfpc}
 

+ 1 - 1
tests/tbs/tb0542.pp

@@ -1,5 +1,5 @@
 { %norun }
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 procedure t;
 var

+ 1 - 1
tests/test/cg/tcnvptr.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-vw -Sew }
 
 var
   p : pointer;

+ 1 - 1
tests/test/tfwork2.pp

@@ -1,6 +1,6 @@
 { %target=linux,solaris,freebsd,win32 }
 { %fail }
-{ %opt=-Sew }
+{ %opt=-vw -Sew }
 
 { just some random non-darwin targets }
 

+ 1 - 1
tests/test/tmainnam.pp

@@ -1,6 +1,6 @@
 { %recompile }
 { %fail }
-{ %opt=-Sew -Cn }
+{ %opt=-vw -Sew -Cn }
 
 uses umainnam;
 

+ 1 - 1
tests/webtbf/tw0769b.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 { %fail }
 { this should generate a warning
   because s is not initialized }

+ 1 - 1
tests/webtbf/tw0769c.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 { %fail }
 { this should generate a warning
   because s is not initialized }

+ 1 - 1
tests/webtbf/tw10833a.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 { %fail }
 procedure p;experimental;
   begin

+ 1 - 1
tests/webtbf/tw10849.pp

@@ -1,5 +1,5 @@
 { %fail }
-{ %opt=-Se1w2 }
+{ %opt=-Se1w2 -vw }
 
 var
   pc: pchar;

+ 1 - 1
tests/webtbf/tw11846.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew -Oodfa }
+{ %OPT=-Sew -vw -Oodfa }
 { %NORUN }
 { %fail }
 {$mode objfpc}

+ 1 - 1
tests/webtbf/tw11846c.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew -Oodfa }
+{ %OPT=-Sew -vw -Oodfa }
 { %NORUN }
 { %fail }
 {$mode objfpc}

+ 1 - 1
tests/webtbf/tw11848a.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew -Oodfa }
+{ %OPT=-Sew -vw -Oodfa }
 { %FAIL }
 {$mode objfpc}{$H+}
 

+ 1 - 1
tests/webtbf/tw11849a.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew -Oodfa }
+{ %OPT=-Sew -vw -Oodfa }
 { %fail }
 {$mode objfpc}
 procedure GiveMe(var i: integer);

+ 18 - 0
tests/webtbf/tw12075.pp

@@ -0,0 +1,18 @@
+{ %fail }
+{ %opt=-Sew -vw-}
+
+{$mode macpas}
+program popwarnings;
+var
+    p: Pointer;
+    offs: PtrInt;
+    a: array[ 1..100] of integer;
+begin
+{$warnings on}
+    p:= @a;
+    offs:= SizeOf(integer);
+{$push}
+{$warnings off}
+{$pop}
+    PtrUInt(p):=PtrUInt(p) + offs;
+end.

+ 1 - 1
tests/webtbf/tw2209.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 { %fail }
 
 { Source provided for Free Pascal Bug Report 2209 }

+ 1 - 1
tests/webtbf/tw2752.pp

@@ -1,5 +1,5 @@
 { %fail }
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 2752 }
 { Submitted by "Micha" on  2003-10-26 }

+ 1 - 1
tests/webtbf/tw3553.pp

@@ -1,5 +1,5 @@
 { %fail }
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 3553 }
 { Submitted by "Naj Kejah" on  2005-01-15 }

+ 1 - 1
tests/webtbf/tw3562.pp

@@ -1,5 +1,5 @@
 { %fail }
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 procedure p;
 var

+ 1 - 1
tests/webtbf/tw3631.pp

@@ -1,5 +1,5 @@
 { %fail }
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 var
   a : array[0..32] of byte;

+ 1 - 1
tests/webtbf/tw3643.pp

@@ -1,5 +1,5 @@
 { %fail }
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 3643 }
 { Submitted by "Naj Kejah" on  2005-02-08 }

+ 1 - 1
tests/webtbf/tw4139.pp

@@ -1,5 +1,5 @@
 { %fail }
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 4139 }
 { Submitted by "Christian Iversen" on  2005-06-29 }

+ 1 - 1
tests/webtbf/tw4737.pp

@@ -1,5 +1,5 @@
 { %fail }
-{ %OPT=-CO -Sewnh -vh}
+{ %OPT=-CO -Sewnh -vwnh }
 { changed -Seh to -Sewnh because -Cr option
   changes the hint into a warning PM }
 

+ 1 - 1
tests/webtbf/tw8151b.pp

@@ -1,4 +1,4 @@
-{ %opt=-Oodfa -Sew }
+{ %opt=-Oodfa -Sew -vw }
 { %fail }
 {$IFDEF FPC}
   {$mode delphi}

+ 1 - 1
tests/webtbf/tw8151c.pp

@@ -1,4 +1,4 @@
-{ %opt=-Oodfa -Sew }
+{ %opt=-Oodfa -Sew -vw }
 { %fail }
 {$IFDEF FPC}
   {$mode delphi}

+ 1 - 1
tests/webtbf/tw8264a.pp

@@ -1,5 +1,5 @@
 { %fail }
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 {$mode delphi}
 

+ 1 - 1
tests/webtbs/tw0769.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 { this should generate no warning }
 
 {$mode tp}

+ 1 - 1
tests/webtbs/tw10736.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 
 unit tw10736;
 

+ 1 - 1
tests/webtbs/tw10931.pp

@@ -1,4 +1,4 @@
-{ %opt=-Cr -Sew }
+{ %opt=-Cr -Sew -vw }
 
 var
   a: PtrUInt;

+ 2 - 2
tests/webtbs/tw11846a.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew -Oodfa }
+{ %OPT=-Sew -vw -Oodfa }
 { %NORUN }
 {$mode objfpc}
 function Test(a: integer): boolean;
@@ -10,4 +10,4 @@ begin
 end;
 
 begin
-end.
+end.

+ 1 - 1
tests/webtbs/tw11846b.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew -Oodfa }
+{ %OPT=-Sew -vw -Oodfa }
 { %NORUN }
 {$mode objfpc}
 function Test(a: integer): boolean;

+ 1 - 1
tests/webtbs/tw11848.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew -Oodfa }
+{ %OPT=-Sew -vw -Oodfa }
 { %NORUN }
 {$mode objfpc}{$H+}
 

+ 1 - 1
tests/webtbs/tw11849.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew -Oodfa }
+{ %OPT=-Sew -vw -Oodfa }
 { %norun }
 {$mode objfpc}
 procedure GiveMe(out i: integer);

+ 1 - 1
tests/webtbs/tw12050a.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 { %fail }
 
 unit tw12050a;

+ 1 - 1
tests/webtbs/tw12050b.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 
 unit tw12050b;
 {$mode macpas}

+ 16 - 0
tests/webtbs/tw12076.pp

@@ -0,0 +1,16 @@
+{ %opt=-vw -Sew }
+{ %norun }
+{$mode macpas}
+program nowarnings;
+var
+    p: Pointer;
+    offs: PtrInt;
+    a: array[ 1..100] of integer;
+begin
+{$warnings on}
+    p:= @a;
+    offs:= SizeOf(integer);
+{$warnings off}
+    PtrUInt(p):=PtrInt(p) + offs;
+{$warnings on}
+end.

+ 1 - 1
tests/webtbs/tw12508a.pp

@@ -1,5 +1,5 @@
 { %norun }
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 procedure test(a: longint);
 var

+ 1 - 1
tests/webtbs/tw1851.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 {$mode objfpc}{$H+}
 

+ 1 - 1
tests/webtbs/tw1948.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 1948 }
 { Submitted by "Sergey Kosarevsky" on  2002-04-27 }

+ 1 - 1
tests/webtbs/tw2307.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 { Source provided for Free Pascal Bug Report 2307 }
 { Submitted by "Sergey Kosarevsky" on  2003-01-03 }
 { e-mail: [email protected] }

+ 1 - 1
tests/webtbs/tw2425.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sen }
+{ %OPT=-Sen -vn }
 
 { Source provided for Free Pascal Bug Report 2425 }
 { Submitted by "Marco van de Voort" on  2003-03-18 }

+ 1 - 1
tests/webtbs/tw2435.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 2435 }
 { Submitted by "Louis Jean-Richard" on  2003-03-24 }

+ 1 - 1
tests/webtbs/tw2438.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 2438 }
 { Submitted by "Armin Diehl" on  2003-03-25 }

+ 1 - 1
tests/webtbs/tw2710.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 2710 }
 { Submitted by "Micha Nelissen" on  2003-10-04 }

+ 1 - 1
tests/webtbs/tw2789.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sen }
+{ %opt=-Sen -vn }
 
 Var B:Longint;
 

+ 1 - 1
tests/webtbs/tw2815.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 2815 }
 { Submitted by "Mattias Gaertner" on  2003-11-30 }

+ 1 - 1
tests/webtbs/tw2817.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sen }
+{ %opt=-Sen -vn }
 
 { Source provided for Free Pascal Bug Report 2817 }
 { Submitted by "Mattias Gaertner" on  2003-11-30 }

+ 1 - 1
tests/webtbs/tw2832.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 2832 }
 { Submitted by "Mattias Gaertner" on  2003-12-05 }

+ 1 - 1
tests/webtbs/tw2841.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 2841 }
 { Submitted by "Mattias Gaertner" on  2003-12-09 }

+ 1 - 1
tests/webtbs/tw3172.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 type
   PUI32 = ^Longword;

+ 1 - 1
tests/webtbs/tw3281.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 {$ifdef fpc}{$mode objfpc}{$endif}
 {$M+}

+ 1 - 1
tests/webtbs/tw3364.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 3364 }
 { Submitted by "Sergey Kosarevsky" on  2004-10-22 }

+ 1 - 1
tests/webtbs/tw3490.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 3490 }
 { Submitted by "Tomas Hajny" on  2004-12-29 }

+ 1 - 1
tests/webtbs/tw3567.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 (*$WEAKPACKAGEUNIT*)
 (*$HPPEMIT '#include "some_include.h"' *)

+ 1 - 1
tests/webtbs/tw3669.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 3669 }
 { Submitted by "Mattias Gaertner" on  2005-02-19 }

+ 1 - 1
tests/webtbs/tw3952.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 3952 }
 { Submitted by "Ivo Steinmann" on  2005-05-08 }

+ 1 - 1
tests/webtbs/tw3970.pp

@@ -1,4 +1,4 @@
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 3970 }
 { Submitted by "Yiannis Dondos" on  2005-05-15 }

+ 1 - 1
tests/webtbs/tw4006.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 { Source provided for Free Pascal Bug Report 4006 }
 { Submitted by "Torsten Kildal" on  2005-05-23 }

+ 1 - 1
tests/webtbs/tw4043.pp

@@ -1,5 +1,5 @@
 { %target=win32 }
-{ %OPT=-Sew }
+{ %OPT=-Sew -vw }
 
 uses
   windows;

+ 1 - 1
tests/webtbs/tw4068.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sen }
+{ %opt=-Sen -vn }
 
 { Source provided for Free Pascal Bug Report 4068 }
 { Submitted by "David Butler" on  2005-06-12 }

+ 1 - 1
tests/webtbs/tw4330.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 {$A+}
 {$A-}

+ 1 - 1
tests/webtbs/tw4332.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 {$W+}
 {$W-}

+ 1 - 1
tests/webtbs/tw4954.pp

@@ -1,5 +1,5 @@
 { %NORUN }
-{ %OPT=-Seh }
+{ %OPT=-Seh -vh }
 
 program aFP211r;  { false hints on varrec }
 

+ 1 - 1
tests/webtbs/tw5100.pp

@@ -1,5 +1,5 @@
 { %norun }
-{ %OPT=-Sen }
+{ %OPT=-Sen -vn }
 
 unit tw5100; 
 

+ 1 - 1
tests/webtbs/tw5100a.pp

@@ -1,5 +1,5 @@
 { %norun }
-{ %OPT=-Sen }
+{ %OPT=-Sen -vn }
 { %fail }
 
 unit tw5100a; 

+ 1 - 1
tests/webtbs/tw7179.pp

@@ -1,4 +1,4 @@
-{ %opt=-Seh }
+{ %opt=-Seh -vh }
 
 {$mode delphi}
 program TestMismatch;

+ 1 - 1
tests/webtbs/tw7285.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sehw -S2 }
+{ %opt=-Sehw -vwh -S2 }
 
 type myclass=class(TObject)
       procedure myproc(); 

+ 1 - 1
tests/webtbs/tw7808.pp

@@ -1,6 +1,6 @@
 { %cpu=i386 }
 { %target=go32v2,linux,freebsd,win32}
-{ %opt=-Sew }
+{ %opt=-Sew -vw }
 
 {$mode delphi}
 

+ 1 - 1
tests/webtbs/tw8090.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sen }
+{ %opt=-Sen -vn }
 program notusedbug;
 
 {$mode objfpc}{$H+}

+ 1 - 1
tests/webtbs/tw8151a.pp

@@ -1,4 +1,4 @@
-{ %opt=-Oodfa -Sew }
+{ %opt=-Oodfa -Sew -vw }
 { %norun }
 {$IFDEF FPC}
   {$mode delphi}

+ 1 - 1
tests/webtbs/tw8264.pp

@@ -1,4 +1,4 @@
-{ %opt=-Sen }
+{ %opt=-Sen -vn }
 {$mode delphi}
 
 function calclength1(const s1: shortstring): integer;

+ 1 - 1
tests/webtbs/tw8282.pp

@@ -1,4 +1,4 @@
-{ %opt=-O2 -Sew }
+{ %opt=-O2 -Sew -vw }
 
 {$inline on}
 

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно