C PATCH to add -Wswitch-unreachable (PR c/49859)
Marek Polacek
polacek@redhat.com
Thu May 26 09:32:00 GMT 2016
On Wed, May 25, 2016 at 03:21:00PM -0600, Martin Sebor wrote:
> I see. Thanks for clarifying that. No warning on a declaration
> alone makes sense in the case above but it has the unfortunate
> effect of suppressing the warning when the declaration is followed
> by a statement, such as in:
>
> void f (int*, int);
>
> void g (int i)
> {
> switch (i) {
> int a [3];
> memset (a, 0, sizeof a);
>
> default:
> f (a, 3);
> }
> }
Ah, then I think we should probably look into GIMPLE_TRY, using
gimple_try_eval, too.
Marek
More information about the Gcc-patches
mailing list