[libc-commits] [libc] [libc] remove header guard for assert.h (PR #83334)

via libc-commits libc-commits at lists.llvm.org
Wed Feb 28 13:07:42 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Nick Desaulniers (nickdesaulniers)

<details>
<summary>Changes</summary>

It's meant to be included multiple times! Maybe use a NOLINT rule to suppress
clang-tidy's llvm-header-guard lint warning.


---
Full diff: https://github.com/llvm/llvm-project/pull/83334.diff


1 Files Affected:

- (modified) libc/src/assert/assert.h (-5) 


``````````diff
diff --git a/libc/src/assert/assert.h b/libc/src/assert/assert.h
index 0daf9c4e1e6166..21f6e67eb9625c 100644
--- a/libc/src/assert/assert.h
+++ b/libc/src/assert/assert.h
@@ -6,9 +6,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_LIBC_SRC_ASSERT_ASSERT_H
-#define LLVM_LIBC_SRC_ASSERT_ASSERT_H
-
 #include "src/assert/__assert_fail.h"
 
 // There is no header guard here since assert is intended to be capable of being
@@ -25,5 +22,3 @@
        : LIBC_NAMESPACE::__assert_fail(#e, __FILE__, __LINE__,                 \
                                        __PRETTY_FUNCTION__))
 #endif // NDEBUG
-
-#endif // LLVM_LIBC_SRC_ASSERT_ASSERT_H

``````````

</details>


https://github.com/llvm/llvm-project/pull/83334


More information about the libc-commits mailing list