Now --lesspedantic kills EVELYN the modified DOG
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 23 Sep 2001 16:30:33 +0000 (16:30 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 23 Sep 2001 16:30:33 +0000 (16:30 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1302 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCcse.c
src/SDCCglobl.h
src/SDCClabel.c
src/SDCCmain.c

index b0dc633eece16bd8e099fd32084118e05917de4f..1bff79e102f6ea631e3ddd69921710a554bd9d27 100644 (file)
@@ -1016,7 +1016,9 @@ ifxOptimize (iCode * ic, set * cseSet,
       /* too often, if it does happen then the user pays */
       /* the price */
       computeControlFlow (ebbs, count, 1);
-      werror (W_CONTROL_FLOW, ic->filename, ic->lineno);
+      if (!options.lessPedantic) {
+       werror (W_CONTROL_FLOW, ic->filename, ic->lineno);
+      }
       return;
     }
 
@@ -1030,7 +1032,9 @@ ifxOptimize (iCode * ic, set * cseSet,
 
       remiCodeFromeBBlock (ebb, ic);
       computeControlFlow (ebbs, count, 1);
-      werror (W_CONTROL_FLOW, ic->filename, ic->lineno);
+      if (!options.lessPedantic) {
+       werror (W_CONTROL_FLOW, ic->filename, ic->lineno);
+      }
       return;
     }
 
index b887e795ccb1873be4bf4604e84683a3b5ea730e..99076417680fa03b42a9ebee3e47ec0fa0d2b7c8 100644 (file)
@@ -217,6 +217,7 @@ struct options
     int noRegParams;            /* Disable passing some parameters in registers */
     int verbose;               /* Show what the compiler is doing */
     int shortis8bits;           /* treat short like int or char */
+    int lessPedantic;           /* disable some warnings */
     int profile;                /* Turn on extra profiling information */
     char *calleeSaves[128];    /* list of functions using callee save */
     char *excludeRegs[32];     /* registers excluded from saving */
index 5c26ce6739381c4b6e41874126b4cae62374e45d..99e7252a237550574614dae93a4843bcca17bc88 100644 (file)
@@ -121,7 +121,9 @@ labelIfx (iCode * ic)
            {
 
              /* get rid of this if */
-             werror (W_CONTROL_FLOW, loop->filename, loop->lineno);
+             if (!options.lessPedantic) {
+               werror (W_CONTROL_FLOW, loop->filename, loop->lineno);
+             }
              loop->prev->next = loop->next;
              loop->next->prev = loop->prev;
              hTabDeleteItem (&labelRef,
@@ -136,7 +138,9 @@ labelIfx (iCode * ic)
                  IC_FALSE (loop)->key == IC_LABEL (loop->next)->key)
                {
                  /* get rid of this if */
-                 werror (W_CONTROL_FLOW, loop->filename, loop->lineno);
+                 if (!options.lessPedantic) {
+                   werror (W_CONTROL_FLOW, loop->filename, loop->lineno);
+                 }
                  loop->prev->next = loop->next;
                  loop->next->prev = loop->prev;
                  hTabDeleteItem (&labelRef,
@@ -156,8 +160,9 @@ labelIfx (iCode * ic)
          ((IC_TRUE (loop) && IC_TRUE (loop)->key == IC_LABEL (loop->next)->key) ||
           (IC_FALSE (loop) && IC_FALSE (loop)->key == IC_LABEL (loop->next)->key)))
        {
-
-         werror (W_CONTROL_FLOW, loop->filename, loop->lineno);
+         if (!options.lessPedantic) {
+           werror (W_CONTROL_FLOW, loop->filename, loop->lineno);
+         }
          loop->prev->next = loop->next;
          loop->next->prev = loop->prev;
          hTabDeleteItem (&labelRef,
index 814bae8241b18ecff531c21fa32551f8ab994408..4222a01d7b43906e4f4b14ebef9549177487fb4e 100644 (file)
@@ -862,6 +862,7 @@ parseCmdLine (int argc, char **argv)
 
           if (strcmp (argv[i], OPTION_LESS_PEDANTIC) == 0) 
             {
+             options.lessPedantic = 1;
               setErrorLogLevel(ERROR_LEVEL_WARNING);
               continue;
             }