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

Simon Marchi simark@simark.ca
Tue Dec 17 19:39:00 GMT 2019


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



More information about the Gdb-patches mailing list