Re: [PATCH] Fix -Wmisleading indentation false-positive for do-while statement

2016-01-08 Thread Jakub Jelinek
On Tue, Dec 22, 2015 at 12:33:51PM -0500, Patrick Palka wrote: > We are emitting a bogus warning for the code > > do foo (0); while (flagA); > ^--- NEXT > ^ BODY > ^--- GUARD > > In general I don't think we can get any useful indentation warning out

Re: [PATCH] Fix -Wmisleading indentation false-positive for do-while statement

2016-01-08 Thread Jeff Law
On 01/08/2016 03:43 AM, Jakub Jelinek wrote: On Tue, Dec 22, 2015 at 12:33:51PM -0500, Patrick Palka wrote: We are emitting a bogus warning for the code do foo (0); while (flagA); ^--- NEXT ^ BODY ^--- GUARD In general I don't think we can

Re: [PATCH] Fix -Wmisleading indentation false-positive for do-while statement

2016-01-05 Thread Bernd Schmidt
On 01/05/2016 10:58 PM, David Malcolm wrote: In general I don't think we can get any useful indentation warning out of a do-while statement, so this patch makes it so that we just skip them. Is this OK to commit after testing? It looks like this is PR c++/69029. FWIW, I agree with your

Re: [PATCH] Fix -Wmisleading indentation false-positive for do-while statement

2016-01-05 Thread David Malcolm
On Tue, 2015-12-22 at 12:33 -0500, Patrick Palka wrote: > We are emitting a bogus warning for the code > > do foo (0); while (flagA); > ^--- NEXT > ^ BODY > ^--- GUARD > > In general I don't think we can get any useful indentation warning out > of a

[PATCH] Fix -Wmisleading indentation false-positive for do-while statement

2015-12-22 Thread Patrick Palka
We are emitting a bogus warning for the code do foo (0); while (flagA); ^--- NEXT ^ BODY ^--- GUARD In general I don't think we can get any useful indentation warning out of a do-while statement, so this patch makes it so that we just skip them. Is

[PATCH] Fix -Wmisleading-indentation false-positive

2015-09-21 Thread Patrick Palka
This patch fixes the last remaining false-positive -Wmisleading-indentation warning that is emitted against the sqlite sources. The problem is the following kind of code snippet: for (i = 0; i < 10; i++ ); foo (i); which is an "interesting" coding style but it is

Re: [PATCH] Fix -Wmisleading-indentation false-positive

2015-09-21 Thread Bernd Schmidt
On 09/21/2015 01:23 PM, Patrick Palka wrote: * c-indentation.c (should_warn_for_misleading_indentation): Float out and consolidate the calls to get_visual_column that is passed guard_exploc as an argument. Compare next_stmt_vis_column with guard_line_first_nws