Re: [PATCH] Fix GCC6 -Wmisleading-indentation issues.

Mark Wielaard
2016-01-25T22:14:15Z

On Mon, Jan 25, 2016 at 04:46:10PM -0500, Simon Marchi wrote:
> If you feel like it, you could build with --enable-targets=all to
> enable more code.
> You'll find more of these.

Thanks, but honestly this was just inspired by my desire to get
a local build with gcc6 going. It would be good to build more code
with GCC6 of course. I am sure it will find interesting issues.

> One little comment below, otherwise it LGTM (without implying that my voice is
> worth anything).
>
> > diff --git a/gdb/inflow.c b/gdb/inflow.c
> > index bbd2b12..d1dd41c 100644
> > --- a/gdb/inflow.c
> > +++ b/gdb/inflow.c
> > @@ -413,7 +413,7 @@ child_terminal_ours_1 (int output_only)
> > if (tinfo->run_terminal != NULL || gdb_has_a_terminal () == 0)
> > return;
> >
> > - {
> > + {
> > #ifdef SIGTTOU
> > /* Ignore this signal since it will happen when we try to set the
> > pgrp. */
> > @@ -497,7 +497,7 @@ child_terminal_ours_1 (int output_only)
> > result = fcntl (0, F_SETFL, our_terminal_info.tflags);
> > result = fcntl (0, F_SETFL, our_terminal_info.tflags);
> > #endif
> > - }
> > + }
>
> Shouldn't the code inside the brackets be de-indented too?

Possibly. Or remove the whole block and move stuff into the outer scope
now that it isn't strictly needed. But both create lots of code movement
because of the peculiar ifdefs in this code. And it clearly wasn't the
intention of the original author that removed the if statement in
commit d9d2d8b.

Thanks,

Mark