[libc-commits] [libc] [libc] introduce hardening mode and add heap integrity check as example (PR #210373)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Fri Jul 31 10:13:31 PDT 2026


================
@@ -9,27 +9,69 @@
 #ifndef LLVM_LIBC_SRC___SUPPORT_LIBC_ASSERT_H
 #define LLVM_LIBC_SRC___SUPPORT_LIBC_ASSERT_H
 
+#include "src/__support/macros/attributes.h" // For LIBC_INLINE
+#include "src/__support/macros/config.h"
+#include "src/__support/macros/hardening.h"
+#include "src/__support/macros/macro-utils.h"
+#include "src/__support/macros/optimization.h" // For LIBC_UNLIKEL
+#include "src/__support/macros/properties/os.h"
+
+#ifdef LIBC_FULL_BUILD
+#include "src/__support/OSUtil/exit.h"
+#include "src/__support/OSUtil/io.h"
+#include "src/__support/integer_to_string.h"
+#endif
+
+//===----------------------------------------------------------------------===//
+// _LIBC_ASSERT(COND, MSG) (always-on assert regardless of NDEBUG)
----------------
michaelrj-google wrote:

this name does not at all make clear that this is different from `LIBC_ASSERT`. I'm not sure what the name should be but it should be difficult to confuse with the other version.

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


More information about the libc-commits mailing list