From:  Michael Ellerman
> Sent: 26 May 2017 08:24
> Nicholas Piggin <npig...@gmail.com> writes:
> > diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
> > index f11f65634aab..438fdb0fb142 100644
> > --- a/arch/powerpc/xmon/xmon.c
> > +++ b/arch/powerpc/xmon/xmon.c
> > @@ -1242,14 +1242,16 @@ bpt_cmds(void)
> >  {
> >     int cmd;
> >     unsigned long a;
> > -   int mode, i;
> > +   int i;
> >     struct bpt *bp;
> > -   const char badaddr[] = "Only kernel addresses are permitted "
> > -           "for breakpoints\n";
> >
> >     cmd = inchar();
> >     switch (cmd) {
> > -#ifndef CONFIG_8xx
> > +#ifndef CONFIG_PPC_8xx
> > +   int mode;
> > +   const char badaddr[] = "Only kernel addresses are permitted "
> > +           "for breakpoints\n";
> > +
> >     case 'd':       /* bd - hardware data breakpoint */
> >             mode = 7;
> >             cmd = inchar();
> 
> GCC 7 rejects this:
> 
>   arch/powerpc/xmon/xmon.c: In function bpt_cmds:
>   arch/powerpc/xmon/xmon.c:1252:13: error: statement will never be executed 
> [-Werror=switch-
> unreachable]
>     const char badaddr[] = "Only kernel addresses are permitted for 
> breakpoints\n";
>                ^~~~~~~

Try 'static' ?

        David

Reply via email to