[PATCH v2 1/4] clang-format: should format with 2 space and do not usage tab

Zack Weinberg zack@owlfolio.org
Tue Jun 20 17:45:10 GMT 2023


On Tue, Jun 20, 2023, at 1:17 PM, Yonggang Luo via Libc-alpha wrote:
> -TabWidth:        8
> -UseTab:          Always
> +TabWidth:        2
> +UseTab:          Never ForEachMacros:

This is not right.  GNU style is two spaces per *indent level*, but you
*are* supposed to use hard tabs to compress all runs of 8*n spaces at
the beginning of a line, regardless of the semantics of the spaces (i.e.
unlike some other styles, it doesn't matter whether the spaces represent
nesting or alignment).  I *thought* this was documented somewhere in
https://www.gnu.org/prep/standards/html_node/ but I can't find it (but I
have personally been yelled at on this very mailing list for screwing it
up, so I don't want you to have the same experience).

Whether clang-format can do this correctly, I do not know.

zw


More information about the Libc-alpha mailing list