This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]: Fix enumeration warnings in switch statements



This hopefully "obvious" patch fixes the two places in a full bootstrap
on i686-pc-linux-gnu that trigger warnings following my previous patch
to fix the "-Wswitch" command line option.

Tested by "make bootstrap" and "make -k check" on i686-pc-linux-gnu
with no new regressions, both with and without my earlier patch.

Kaveh, could you please use your cross-compilation scripts to check
the various back-ends to see if any of them suffer from similar
problems?



2001-12-10  Roger Sayle <roger@eyesopen.com>
	* except.c (reachable_next_level): Handle ERT_UNKNOWN to avoid
	compiler warning about enumeration values not being handled.
	* flow.c (find_regno_partial): Similarly add a default case.


*** gcc/gcc/except.c	Fri Nov 23 10:56:19 2001
--- patch11/gcc/except.c	Mon Dec 10 14:09:28 2001
*************** reachable_next_level (region, type_throw
*** 2765,2770 ****
--- 2765,2771 ----

      case ERT_THROW:
      case ERT_FIXUP:
+     case ERT_UNKNOWN:
        /* Shouldn't see these here.  */
        break;
      }
*** gcc/gcc/flow.c	Sun Dec  9 11:27:08 2001
--- patch11/gcc/flow.c	Mon Dec 10 14:10:51 2001
*************** find_regno_partial (ptr, data)
*** 1340,1345 ****
--- 1340,1349 ----
  	    return 1;
  	  }
  	break;
+
+       /* Avoid enumeration value not handled compiler warning.  */
+       default:
+         break;
      }

    return 0;


Roger
--
Roger Sayle,                         E-mail: roger@eyesopen.com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-438-3470



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]