about summary refs log tree commit diff
path: root/support/test-container.c
diff options
context:
space:
mode:
authorNoah Goldstein <goldstein.w.n@gmail.com>2022-04-04 11:56:46 -0500
committerNoah Goldstein <goldstein.w.n@gmail.com>2022-04-11 10:51:03 -0500
commitac5f5a92edd9df5a6994e41309ef4a3580a2aeb1 (patch)
tree5213d7d51e8a9c9a092140a71cf54ed47b0b36fa /support/test-container.c
parentd2265570a7694b5b01d5a0a2d56d3482ac1a5d97 (diff)
downloadglibc-ac5f5a92edd9df5a6994e41309ef4a3580a2aeb1.tar.gz
glibc-ac5f5a92edd9df5a6994e41309ef4a3580a2aeb1.tar.xz
glibc-ac5f5a92edd9df5a6994e41309ef4a3580a2aeb1.zip
Add .clang-format style file
Went with version >= 11.0 since it covers most of the major features
and should be pretty universally accessibly.

There are some issues:

1.  indention of preprocessor directives:
    Unfortunately there doesn't appear to be a switch for a seperate
    'IndentWidth' for preprocessor directives vs. normal code so we
    are stuck either not indenting the directives or over-indenting
    them. i.e:
    Desired:
    ```
    #ifndef A
    # define B
    #endif
    ```
    Options:
    ```
    #ifndef A
    #  define B /* Two spaces instead of one.  */
    #endif

    #ifndef C
    #define D   /* No spaces.  */
    #endif
    ```
    Chose to over-indent as it generally seems easier to script
    halving all pre-processor indentations than counting the nested
    depth and indenting from scratch.

2.  concatenation of lines missing semi-colons:
    Throughout glibc there are macros used to setup aliasing that are
    outside of functions and don't end in semi-colons i.e:
    ```
    libc_hidden_def (__pthread_self)
    weak_alias (__pthread_self, pthread_self)
    ```

    clang-format reformats lines like these to:
    ```
    libc_hidden_def (__pthread_self) weak_alias (__pthread_self, pthread_self)
    ```

    which is generally undesirable.

Other than those two big concerns there are certainly some questions
diffs but for the most part it creates a easy to read and consistent
style.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'support/test-container.c')
0 files changed, 0 insertions, 0 deletions