This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Warning elimination patches in cp/call.c
- To: law at cygnus dot com
- Subject: Re: Warning elimination patches in cp/call.c
- From: Joe Buck <jbuck at synopsys dot com>
- Date: Tue, 10 Mar 98 9:42:00 PST
- Cc: egcs at cygnus dot com
> This is an enormous amount of work, not to mention flat out impossible
> since we allow language front ends to make their own tree nodes.
OK, this makes it clear that we can't expect to individually handle
every case.
> Yes, there may be a few that should be aborts. But the behavior with
> the default: break case matches the current behavior -- which is
> what I think we want to do unless we know its wrong (as has been
> the case for some of the suggested paren warning fixes).
It seems that inserting default: break should be fine in most cases. The
only exception is where each case computes a needed result or returns a
value; here default: break won't compute the result or return a value, so
it seems that there should be a default: abort in such cases (otherwise
we'll wind up with an uninitialized variable or fall off the end of
a function).