This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: A bug or spec? No warning on a switch case not handled.
- To: Kazu Hirata <kazu at hxi dot com>
- Subject: Re: A bug or spec? No warning on a switch case not handled.
- From: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- Date: Sun, 4 Nov 2001 14:53:53 +1100
- Cc: gcc at gcc dot gnu dot org
- References: <200110302134.IAA24589@mumnunah.cs.mu.OZ.AU>
It certainly looks like a bug to me.
On 31-Oct-2001, Kazu Hirata <kazu@hxi.com> wrote:
> gcc-3.0.1 does not give me a warning when compiling the following code
> with -Wswitch. Is this a specification or a bug? (I checked this on
> i386-redhat-linux and h8300-hms.)
>
> enum sw { c1, c2 };
>
> void
> foo (enum sw s)
> {
> switch (s)
> {
> case c1:
> break;
> }
> }
--
Fergus Henderson <fjh@cs.mu.oz.au> | "... it seems to me that 15 years of
The University of Melbourne | email is plenty for one lifetime."
WWW: <http://www.cs.mu.oz.au/~fjh> | -- Prof. Donald E. Knuth