This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix -Wswitch (ie. PR c/4475 and PR c++/3780)
- From: Richard Henderson <rth at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 4 Feb 2002 09:34:44 -0800
- Subject: Re: [PATCH] Fix -Wswitch (ie. PR c/4475 and PR c++/3780)
- References: <20020204154234.Y618@sunsite.ms.mff.cuni.cz>
On Mon, Feb 04, 2002 at 03:42:34PM +0100, Jakub Jelinek wrote:
> PR c/4475, c++/3780:
> * c-common.def (SWITCH_STMT): Add SWITCH_TYPE operand.
> * c-common.h (SWITCH_TYPE): Define.
> * c-typeck.c (c_start_case): Set SWITCH_TYPE.
> * stmt.c (all_cases_count): Set lastval to thisval at end of loop.
> Rename spareness variable to sparseness.
> (expand_end_case_type): Renamed from expand_end_case, use orig_type
> if non-NULL instead of TREE_TYPE (orig_index).
> * tree.h (expand_end_case_type): Renamed from expand_end_case.
> (expand_end_case): Define using expand_end_case_type.
> * c-semantics.c (genrtl_switch_stmt): Pass SWITCH_TYPE
> to expand_end_case_type.
>
> * semantics.c (begin_switch_stmt): Clear SWITCH_TYPE.
> (finish_switch_cond): Set SWITCH_TYPE.
>
> * gcc.dg/Wswitch.c: Fix typos. Don't return unconditionally
> before all tests. Move warning one line above to match where it
> C frontend emits.
> * gcc.dg/Wswitch-2.c: New test.
> * g++.dg/warn/Wswitch-1.C: New test.
> * g++.dg/warn/Wswitch-2.C: New test.
Ok.
r~