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

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


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

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


>From ab655f99c16d07e38e4291f2f22aa5ae7eba9601 Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Wed, 28 Feb 2024 13:06:14 -0800
Subject: [PATCH] [libc] remove header guard for assert.h

It's meant to be included multiple times! Maybe use a NOLINT rule to suppress
clang-tidy's llvm-header-guard lint warning.
---
 libc/src/assert/assert.h | 5 -----
 1 file changed, 5 deletions(-)

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



More information about the libc-commits mailing list