[libc-commits] [libc] [libc] Fix gcc warnings. (PR #240958)
Pavel Labath via libc-commits
libc-commits at lists.llvm.org
Wed Nov 11 00:03:34 PST 2026
================
@@ -34,6 +34,11 @@ class AllocChecker {
LIBC_INLINE static void *alloc(size_t s, AllocChecker &ac) {
void *mem = ::malloc(s);
ac = (mem != nullptr);
+#ifdef LIBC_COMPILER_IS_GCC
+ // Prevent GCC's -Wmismatched-new-delete from tracking the inlined malloc
+ // call back from our custom operator delete overloads.
+ __asm__("" : "+r"(mem));
----------------
labath wrote:
This looks like it could pessimize codegen. WDYT about disabling the warning instead?
https://github.com/llvm/llvm-project/pull/240958
More information about the libc-commits
mailing list