]> git.ipfire.org Git - thirdparty/curl.git/commit
memdebug: set gcc 11+ deallocator attribute, extend alloc attributes to clang
authorViktor Szakats <commit@vsz.me>
Sat, 15 Mar 2025 22:22:19 +0000 (23:22 +0100)
committerViktor Szakats <commit@vsz.me>
Sun, 16 Mar 2025 13:02:08 +0000 (14:02 +0100)
commitd5b403074ed2b28e41e0c17dcd436252d38adfa3
treef9e35ae8cf65833ad78e74e183f4e6e8533e6640
parent4911e7af119c1b7efd46a742d47bca44832c3041
memdebug: set gcc 11+ deallocator attribute, extend alloc attributes to clang

To make `-Wfree-nonheap-object` and `-Wmismatched-dealloc` work in
`CURLDEBUG` builds.

Also extend `ALLOC_FUNC` and `ALLOC_SIZE` attribute support
to llvm/clang.

llvm/clang is missing the deallocator attribute, tracked here:
https://github.com/llvm/llvm-project/issues/129068

Ref: https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Common-Function-Attributes.html#Common-Function-Attributes
Ref: https://www.gnu.org/software/gcc/gcc-11/changes.html
Ref: 6b143d9cc13fcd208480f678dfd06bf97bde4998 #16734

Closes #16737
lib/memdebug.c
lib/memdebug.h