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

Pedro Alves
2016-01-25T22:24:50Z

On 01/25/2016 10:14 PM, Mark Wielaard wrote:
> On Mon, Jan 25, 2016 at 04:46:10PM -0500, Simon Marchi wrote:

>> 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.

Yeah... It was part being lazy and port not wanting to mess git blame for
such old code much. There's an easy way around it though. Add an
else, like:

if (tinfo->run_terminal != NULL || gdb_has_a_terminal () == 0)
return;
+ else
{

Or, reverse the condition, like:

- if (tinfo->run_terminal != NULL || gdb_has_a_terminal () == 0)
- return;
+ if (tinfo->run_terminal == NULL && gdb_has_a_terminal ())
{

Thanks,
Pedro Alves