diff -r db06dda7ac4d -r a10c3e127050 src/cx/allocator.h --- a/src/cx/allocator.h Sun Oct 03 12:04:27 2021 +0200 +++ b/src/cx/allocator.h Sun Oct 03 13:07:48 2021 +0200 @@ -121,7 +121,7 @@ * @return a pointer to the allocated memory */ void *cxMalloc(CxAllocator allocator, size_t n) -__attribute__((__malloc__)); +__attribute__((__malloc__, __alloc_size__(2))); /** * Re-allocate the previously allocated block in \p mem, making the new block \p n bytes long. @@ -136,7 +136,7 @@ * @return a pointer to the re-allocated memory */ void *cxRealloc(CxAllocator allocator, void *mem, size_t n) -__attribute__((warn_unused_result)); +__attribute__((__warn_unused_result__, __alloc_size__(3))); /** * Re-allocate a previously allocated block and changes the pointer in-place, if necessary. @@ -154,7 +154,7 @@ * @return zero on success, non-zero on failure */ int cxReallocate(CxAllocator allocator, void **mem, size_t n) -__attribute__((nonnull)); +__attribute__((__nonnull__)); /** * Allocate \p nelem elements of \p n bytes each, all initialized to zero. @@ -165,7 +165,7 @@ * @return a pointer to the allocated memory */ void *cxCalloc(CxAllocator allocator, size_t nelem, size_t n) -__attribute__((malloc)); +__attribute__((__malloc__, __alloc_size__(2, 3))); /** * Free a block allocated by this allocator. @@ -176,7 +176,7 @@ * @param mem a pointer to the block to free */ void cxFree(CxAllocator allocator, void *mem) -__attribute__((nonnull)); +__attribute__((__nonnull__)); #ifdef __cplusplus } /* extern "C" */