[libcxx-commits] [PATCH] D130507: [libc++] Generalize the customizeable assertion handler

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 25 11:57:08 PDT 2022


philnik accepted this revision as: philnik.
philnik added a comment.

LGTM % nits.



================
Comment at: libcxx/src/assert.cpp:28
 _LIBCPP_WEAK
-void __libcpp_assertion_handler(char const* __file, int __line, char const* __expression, char const* __message) {
-  std::fprintf(stderr, "%s:%d: libc++ assertion '%s' failed. %s\n", __file, __line, __expression, __message);
+void __libcpp_assertion_handler(char const* __format, ...) {
+  // Write message to stderr. We do this before formatting into a
----------------
Why are you __uglyfying the names inside the `.cpp`?


================
Comment at: libcxx/src/assert.cpp:38-39
+
+  // Format into a buffer for CrashReporter & friends
+  // Format the arguments into an allocated buffer for CrashReport & friends.
+  // We leak the buffer on purpose, since we're about to abort() anyway.
----------------
Duplicate comment?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130507/new/

https://reviews.llvm.org/D130507



More information about the libcxx-commits mailing list