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

Andrew Pinski pinskia@gmail.com
Wed Jun 21 17:49:26 GMT 2023


On Wed, Jun 21, 2023 at 10:42 AM 罗勇刚(Yonggang Luo) via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> On Thu, Jun 22, 2023 at 1:35 AM Joseph Myers <joseph@codesourcery.com>
> wrote:
> >
> > On Wed, 21 Jun 2023, Carlos O'Donell via Libc-alpha wrote:
> >
> > > It is *my* failing as a steward for the project if we don't make this
> > > easy, and I like clang-format because it makes this easy. I don't
> > > actually care what we pick but we should as project pick something and
> > > make it easy to support developers.
> >
> > Personally I like not using tabs, but (a) the current glibc convention
> > definitely uses tabs and (b) changes like that definitely don't belong in
> > an unrelated patch series.
> >
> > I don't think the convention of tabs for every eight columns is
> > *documented* GNU style, it's more like "GNU style by default because it's
> > what Emacs does by default" (you can stop Emacs doing it with an
> > appropriate .dir-locals.el, but then you need to re-enable tabs in
> > .dir-locals.el for makefile-mode and any other modes that should continue
> > to use tabs).
>
> clang-format --style=GNU -dump-config
>
> show the default GNU style won't use tab, and Emacs is not the sole editor,
> I am not using Emcas,
> For other editors, 8 tab is rare, so when I am reading the glib code, the
> indent mixed space/tab looks weird

Note vi defaults to 8 spaces to a tab too.
I suspect the non-8 spaces are non-UNIX first editors. I know
notepad++ defaults to 4 spaces but I changed the settings there to 8
because I actually like 8 spaces to the tab idea; 4 seems too little.

Thanks,
Andrew Pinski

>
>
> >
> > --
> > Joseph S. Myers
> > joseph@codesourcery.com
>
>
>
> --
>          此致
>> 罗勇刚
> Yours
>     sincerely,
> Yonggang Luo


More information about the Libc-alpha mailing list