Re: [PATCH] Refactor -Wmisleading-indentation API and extend coverage

2015-06-08 Thread Patrick Palka
On Mon, Jun 8, 2015 at 2:45 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Patrick Palka patr...@parcs.ath.cx writes: At the same time this patch extends the coverage of the -Wmisleading-indentation implementation to catch misleading indentation involving the semicolon. (These

Re: [PATCH] Refactor -Wmisleading-indentation API and extend coverage

2015-06-08 Thread Richard Sandiford
Patrick Palka patr...@parcs.ath.cx writes: On Mon, Jun 8, 2015 at 2:11 PM, David Malcolm dmalc...@redhat.com wrote: void warn_for_misleading_indentation (const common_token_info guard_tinfo, const common_token_info body_tinfo,

Re: [PATCH] Refactor -Wmisleading-indentation API and extend coverage

2015-06-08 Thread Patrick Palka
On Mon, Jun 8, 2015 at 2:11 PM, David Malcolm dmalc...@redhat.com wrote: On Sun, 2015-06-07 at 16:06 -0400, Patrick Palka wrote: This patch refactors the entry point of -Wmisleading-indentation Thanks for working on this. I was hoping to submit a patch to propose putting

Re: [PATCH] Refactor -Wmisleading-indentation API and extend coverage

2015-06-08 Thread David Malcolm
On Sun, 2015-06-07 at 16:06 -0400, Patrick Palka wrote: This patch refactors the entry point of -Wmisleading-indentation Thanks for working on this. I was hoping to submit a patch to propose putting -Wmisleading-indentation into -Wall, and have been testing the warning on the linux kernel to

Re: [PATCH] Refactor -Wmisleading-indentation API and extend coverage

2015-06-08 Thread Richard Sandiford
Patrick Palka patr...@parcs.ath.cx writes: At the same time this patch extends the coverage of the -Wmisleading-indentation implementation to catch misleading indentation involving the semicolon. (These changes are all contained in c-indentation.c.) For example, now we warn on the following

[PATCH] Refactor -Wmisleading-indentation API and extend coverage

2015-06-07 Thread Patrick Palka
This patch refactors the entry point of -Wmisleading-indentation from: void warn_for_misleading_indentation (location_t guard_loc, location_t body_loc, location_t next_stmt_loc, enum

Re: [PATCH] Refactor -Wmisleading-indentation API and extend coverage

2015-06-07 Thread Patrick Palka
The new heuristic turns out to trigger a common false positive (see test case below) in many programs. I have applied this diff on top of the original patch to make the heuristic more strict. diff --git a/gcc/c-family/c-indentation.c b/gcc/c-family/c-indentation.c index d3e842b..5532ff4 100644