This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix GCC6 -Wmisleading-indentation issues.
- From: Pedro Alves <palves at redhat dot com>
- To: Mark Wielaard <mjw at redhat dot com>, Simon Marchi <simon dot marchi at ericsson dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 25 Jan 2016 22:24:45 +0000
- Subject: Re: [PATCH] Fix GCC6 -Wmisleading-indentation issues.
- Authentication-results: sourceware.org; auth=none
- References: <1453750851-29990-1-git-send-email-mjw at redhat dot com> <56A697A2 dot 9060207 at ericsson dot com> <20160125221411 dot GA2721 at blokker dot redhat dot com>
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