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

Simon Marchi
2019-12-17T19:53:40Z

On 2019-12-17 2:41 p.m., Pedro Alves wrote:
> On 12/17/19 7:39 PM, Simon Marchi wrote:
>> 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...
>
> Yes, I think it's worth it. Part of the point of using pre release compilers
> is to catch&fix issues before they are released.

Ok, I opened this:

https://bugs.llvm.org/show_bug.cgi?id=44324

Simon