This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
switches with no default case
- To: gcc at gcc dot gnu dot org
- Subject: switches with no default case
- From: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- Date: Thu, 4 Jan 2001 02:51:50 +1100
The Mercury front-end knows when a switch's cases are
exhaustive, and so no default case is needed,
i.e. when the default case is unreachable.
What's the best way to inform the gcc back-end of this?
(a) emit a default label with a BARRIER following it
(b) use an appropriate range type for the switch expression
(c) both of the above
(d) something else?
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.