[libcxx-commits] [libcxx] [libc++][hardening] Add a greppable prefix to assertion messages. (PR #150560)

Hristo Hristov via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 24 21:24:54 PDT 2025


================
@@ -20,8 +20,8 @@
 #define _LIBCPP_ASSERT(expression, message)                                                                            \
   (__builtin_expect(static_cast<bool>(expression), 1)                                                                  \
        ? (void)0                                                                                                       \
-       : _LIBCPP_ASSERTION_HANDLER(__FILE__ ":" _LIBCPP_TOSTRING(__LINE__) ": assertion " _LIBCPP_TOSTRING(            \
-             expression) " failed: " message "\n"))
+       : _LIBCPP_ASSERTION_HANDLER(__FILE__ ":" _LIBCPP_TOSTRING(                                                      \
+             __LINE__) ": libc++ Hardening assertion " _LIBCPP_TOSTRING(expression) " failed: " message "\n"))
----------------
H-G-Hristov wrote:

I guess `libc++` will be more familiar to end-users than `libcxx`. Would it also make sense to use `h` instead of `H` in `Hardening`? I can imagine most people will just type `hardening assertion` or `hardening`.

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


More information about the libcxx-commits mailing list