* support/Util/SDCCerr.c,
[fw/sdcc] / src / SDCClabel.c
index de023c83af72b365183a238cba640e4a9d2fbdd4..718e75f90fd3f7cb30ab7d57bf7ffb90c3276be4 100644 (file)
@@ -384,6 +384,7 @@ labelUnreach (iCode * ic)
       /* statement is not a label           */
       if (loop->op == GOTO || loop->op == RETURN)
        {
+         int warn = 0;
 
          if (loop->next &&
              (loop->next->op == LABEL ||
@@ -405,15 +406,22 @@ labelUnreach (iCode * ic)
                  hTabDeleteItem (&labelRef, IC_LABEL (tic)->key, tic, DELETE_ITEM, NULL);
                  break;
                case IFX:
+                 warn = 1;
                  if (IC_TRUE (tic))
                    hTabDeleteItem (&labelRef, IC_TRUE (tic)->key, tic, DELETE_ITEM, NULL);
                  else
                    hTabDeleteItem (&labelRef, IC_FALSE (tic)->key, tic, DELETE_ITEM, NULL);
                  break;
+               default:
+                 warn = 1;
 
                }
            }
 
+         if (warn)
+           werrorfl (loop->next->filename, loop->next->lineno,
+                     W_CODE_UNREACH);
+
          /* now set up the pointers */
          loop->next = loop2;
          if (loop2)