Skip to content

Commit dab219e

Browse files
committed
[libc] Enable llvmlibc clang-tidy checks
Summary: Add clang-tidy for llvm-libc source directory. Example of check in action: ``` /workspace/llvm-project/libc/src/string/strcpy.cpp:10:1: error: system include stdio.h not allowed [llvmlibc-restrict-system-libc-headers,-warnings-as-errors] #include <stdio.h> ^~~~~~~~~~~~~~~~~~ ``` Reviewers: sivachandra, abrachet Reviewed By: sivachandra, abrachet Subscribers: aheejin, MaskRay, tschuett, libc-commits Tags: #libc-project Differential Revision: https://reviews.llvm.org/D76559
1 parent 816ad48 commit dab219e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

libc/src/.clang-tidy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Checks: '-*,llvmlibc-*'
2+
HeaderFilterRegex: '.*'
3+
WarningsAsErrors: 'llvmlibc-*'
4+
CheckOptions:
5+
- key: llvmlibc-restrict-system-libc-headers.Includes
6+
value: '-*, linux/*, asm/unistd.h'

libc/src/math/round_redirector.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// Include okay for this redirector.
10+
// NOLINTNEXTLINE(llvmlibc-restrict-system-libc-headers)
911
#include <math.h>
1012

1113
namespace __llvm_libc {

0 commit comments

Comments
 (0)