Skip to content

Commit

Permalink
Remove gcc specific malloc(free) attribute
Browse files Browse the repository at this point in the history
Clang doesn't support this, so the analyzer fails using this
  • Loading branch information
btrkeks committed May 28, 2024
1 parent a8d3cc1 commit 0ca8f9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ typedef __PTRDIFF_TYPE__ size;
/**
* Memory allocation wrapper which abort on failure
*/
__attribute__((malloc (free), returns_nonnull)) void *xcalloc(size_t nmemb, size_t size);
__attribute__((malloc (free), returns_nonnull)) void *xrealloc(void *ptr, size_t size);
__attribute__((malloc, returns_nonnull)) void *xcalloc(size_t nmemb, size_t size);
__attribute__((malloc, returns_nonnull)) void *xrealloc(void *ptr, size_t size);
// clang-format off
#define new(type, num) xcalloc(num, sizeof(type))
// clang-format on
Expand Down

0 comments on commit 0ca8f9b

Please sign in to comment.