On 12/09/2015 05:49 PM, David Malcolm wrote:
+void
+fn_40_implicit_level_1 (int arg)
+{
+if (flagA)
+  foo (0);
+
+  foo (1);
+

The distinction I want to make here is between badly indented code vs
misleadingly indented code.  Yes, the code is badly indented, but to my
eyes the code is sufficiently badly indented that it has become *not*
misleading: I can immediately see that something is awry.

To my eyes and brain the effect of this code is disconcerting to the point of confusion (and there was a case recently where a patch was posted with a similar problem and it initially made me misinterpret the code). So - if a human had seen this they'd have fixed it. Code like this could have come in through a misapplied patch for example, and you'd want to warn in such a case.

Do we actually have any users calling for this heuristic?

FWIW, gcc trunk is clean with the blank-lines heuristic, but not without
it  (see the URL above for the 3 places I know of that fire without the
heuristic).

That's a fairly low false-positive rate if we even want to call it that. I'd fix the three examples and leave the warning code as is. We can revisit the decision if we get a flood of bug reports.


Bernd

Reply via email to