Enable -Wmisleading-indentation to balance with the LLVM style of optional parentheses.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
might as well enable it for LLVM more generally? (though probably lldb specifically, and lots of llvm more generally, would need cleanup before this is enabled? Have you checked if lldb or other parts of llvm build cleanly with this warning enabled?)
I think some people are already building with this warning + -Werror so this should be fine (Apparently that list of people includes me and Stella as I fixed a warning that broke the build in https://reviews.llvm.org/D99694#2671667 )
@dblaikie I have checked lldb, it builds cleanly. In the downstream swift branch of lldb there were a couple issues.
I'll check llvm.
Sounds good to me if - if the build (of ~everything in the monorepo) is clean - and do please keep an eye on the buildbots when this is committed as there's likely to be cleanup here and there still required.
In both gcc and clang, -Wmisleading-indentation is part of -Wall as far as I can tell: https://godbolt.org/z/Msaz6Kb6T
In which build configuration does this change have an effect?
@thakis thanks for pointing that out. I had tried -Wall using the clang included with the latest version of Xcode, and that does not enable -Wmisleading-indentation. I see from the compiler explorer that recent clang versions do include misleading indentation diagnostics with -Wall. It seems worth keeping in until an Xcode release includes it with -Wall.
I remember some noise due to this option (albeit on GCC), because it stops tracking indentation when the number of lines is too big, as it is for files including TableGen'ed inc files. Not sure if there is a way to improve it.
Thanks for pointing this out, I didn't know Xcode's clang has a different -Wall set than normal clang. I agree it makes sense to opt in to this then.