Re: [PATCH] Fix indentation (and clang warning) in c-lang.c

Simon Marchi
2019-12-17T19:39:49Z

On 2019-12-17 2:24 p.m., Pedro Alves wrote:
> Curious. Are you saying that that changed recently in clang? I wonder
> whether clang's warning catches this case on purpose, or whether it's
> a regression. I asked David Malcolm, who added that warning to GCC, and he
> said that GCC's implementation respects tab stops, so small numbers of
> leading spaces before a tab are effectively ignored.

The warning appears to be new in clang 10, because it doesn't exist in clang 9:

$ clang++ test.cpp -Wmisleading-indentation
warning: unknown warning option '-Wmisleading-indentation'; did you mean '-Wbinding-in-condition'? [-Wunknown-warning-option]

I can't tell if it's on purpose or not. I wonder if it's worth opening a bug
on clang's bugzilla to ask whether it's intentional or not, it might help them
tweak the warning before it's officially released...

Simon