Issue 60984
Summary Make libc code lint clean
Labels code-cleanup, libc
Assignees sivachandra, lntue, michaelrj-google
Reporter sivachandra
    After https://reviews.llvm.org/D144705, it is possible to run linting on the libc source code again. Because of the long time since we last did any formal lint checking, the source tree has regressed in a number of places with respect to code style. Also, the new `LIBC_INLINE` tag is missing in a number of places. This is issue is about making the libc source lint clean so that we can start running linting on a CI builder.

Addressing this bug has to be a team effort as a large part of the source tree is affected. The best way to start doing the cleanup is this:

1. Build clang and clang-tidy from head and install it into a special directory, say `~/libc-lint-tools/`.
2. Configure libc with:
    ```
    cmake -G Ninja ../llvm -DLLVM_ENABLE_PROJECTS="libc" -DCMAKE_BUILD_TYPE=Debug -DLLVM_LIBC_FULL_BUILD=ON
 -DCMAKE_CXX_COMPILER=~/libc-lint-tools/bin/clang++ -DCMAKE_C_COMPILER=~/libc-lint-tools/bin/clang
 -DLLVM_LIBC_CLANG_TIDY=~/libc-lint-tools/bin/clang-tidy 
    ```
3. Build any lint target, for example, `libc.src.string.strlen.__lint__` or just execute the `libc-lint` target. They should you a large number of lint problems.
4. Send patches to problems identified in step 3.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to