On default configuration of GNU Indent, it uses 8-width tabs.
Because GNU Indent's indentation works like UT_ForContinuationAndIndentation in clang-format, this commit replaces UseTab value from UT_Never to UT_ForContinuationAndIndentation.
Quoting Clang-Format Style Options (15.0.0git):
BasedOnStyle (String)
...
GNU A style complying with the GNU coding standards
Quoting GNU Coding Standards:
The rest of this section gives our recommendations for other aspects of C formatting style, which is also the default style of the indent program in version 1.2 and newer. It corresponds to the options
-nbad -bap -nbc -bbo -bl -bli2 -bls -ncdb -nce -cp1 -cs -di2 -ndj -nfc1 -nfca -hnl -i2 -ip5 -lp -pcs -psl -nsc -nsobWe don’t think of these recommendations as requirements, because it causes no problems for users if two different programs have different formatting styles.
And GNU Indent Manual:
-ut
--use-tabsUse tabs. This is the default.
See Indentation.
-nut
--no-tabsUse spaces instead of tabs.
See Indentation.
Because neither -nut nor -ut are specified in the GNU Coding Standards' default style, it's -ut (use tabs) by default.
Although using tabs are not requirements (as specified in the GNU Coding Standards), using only spaces is definitely not the default GNU-style indentation.
This kind of indent roughly corresponds to clang-format's UT_ForContinuationAndIndentation. Quoting GNU Indent's source code:
if (settings.use_tabs && (settings.tabsize > 1)) {
...
offset = settings.tabsize - (cur_col - 1) % settings.tabsize; while (cur_col + offset <= align_target) { putc(TAB, output); cur_col += offset; offset = settings.tabsize; } } while (cur_col < target_column) { putc(' ', output); cur_col++; }
This portion from pad_output function first tries to fill tabs for alignment and fine-adjusts with spaces.
To simplify the test case a little bit.