This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Some real-life feedback on -Wmisleading-indentation


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.
(https://gcc.gnu.org/ml/gcc-patches/2015-10/msg03242.html)
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

if (0)
{
     /* 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.


Bernd



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]