This is the mail archive of the
mailing list for the GCC project.
Re: Some real-life feedback on -Wmisleading-indentation
- From: Bernd Schmidt <bernds_cb1 at t-online dot de>
- To: Jeff Law <law at redhat dot com>, David Malcolm <dmalcolm at redhat dot com>, Gerald Pfeifer <gerald at pfeifer dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 12 Jan 2016 18:18:05 +0100
- Subject: Re: Some real-life feedback on -Wmisleading-indentation
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 20 dot 1601101928330 dot 5144 at anthias> <1452524029 dot 5803 dot 80 dot camel at surprise> <569492C8 dot 30304 at redhat dot com>
On 01/12/2016 06:44 AM, Jeff Law wrote:
I would argue that each of these does represent misleading
indentation and that the warning is warranted for each.
Perhaps they aren't as bad as prior cases, but I'd still
consider them mis-leading.
I still stand by that assessment.
ISTM for the wine case the backwards indentation (column-wise) of the IF
may be the right filter, maybe that in conjunction with the blank line
heuristic. However, I stand by my belief that the blank line heuristic
is wrong when used by itself.
I also still agree with this. It's worthy of note that most cases in
Wine that use this pattern enclose the commented out code in braces, as in
/* stuff */
normally indented code
If we warn about this, I'd agree it isn't helpful. IMO code that uses
the pattern Gerald quoted should be fixed to use #if or add braces.