[Bug c/70436] -Wmisleading-indentation missing warning

2016-03-29 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70436 --- Comment #7 from Patrick Palka --- BTW according to a working implementation of this -Wdangling-else warning (not the above broken one I prematurely posted), the only suspicious use of dangling else (i.e. a use in which the indentation is

[Bug c/70436] -Wmisleading-indentation missing warning

2016-03-29 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70436 --- Comment #6 from Patrick Palka --- Turns out the prototype is pretty broken :P

[Bug c/70436] -Wmisleading-indentation missing warning

2016-03-29 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70436 --- Comment #5 from Marek Polacek --- Thanks. I could take care of the C FE side ;). But let's strike this in the next stage1.

[Bug c/70436] -Wmisleading-indentation missing warning

2016-03-29 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70436 --- Comment #4 from Patrick Palka --- Here's a prototype that seems to do the job. Whenever we see an unbraced if, increment the counter. Whenever we see a compound statement, reset the counter. Whenever we see an else, warn if counter > 1

[Bug c/70436] -Wmisleading-indentation missing warning

2016-03-29 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70436 Marek Polacek changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug c/70436] -Wmisleading-indentation missing warning

2016-03-29 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70436 Patrick Palka changed: What|Removed |Added CC||ppalka at gcc dot gnu.org --- Comment

[Bug c/70436] -Wmisleading-indentation missing warning

2016-03-29 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70436 --- Comment #1 from Jakub Jelinek --- Note clang warns here: pr70405-3.c:11:3: warning: add explicit braces to avoid dangling else [-Wdangling-else] else ^ and it warns regardless of the indentation.