From ce2e2b141e67e5be8cc85bc394dc6ca9e15f774b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 5 Aug 2013 20:57:13 +0000 Subject: use gcc malloc attribute for low level allocation functions, prevents gcc from checking if resulting pointers alias existing pointers, also use sentinel attribute for uiButGetStrInfo so incorrect usage gives a warning. --- source/blender/blenlib/BLI_memarena.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/blenlib/BLI_memarena.h') diff --git a/source/blender/blenlib/BLI_memarena.h b/source/blender/blenlib/BLI_memarena.h index 092bb639b91..d54dab42e05 100644 --- a/source/blender/blenlib/BLI_memarena.h +++ b/source/blender/blenlib/BLI_memarena.h @@ -55,6 +55,7 @@ typedef struct MemArena MemArena; struct MemArena *BLI_memarena_new(const int bufsize, const char *name) #if MEM_GNU_ATTRIBUTES +__attribute__((malloc)) __attribute__((warn_unused_result)) __attribute__((nonnull(2))) #endif @@ -85,6 +86,7 @@ __attribute__((nonnull(1))) void *BLI_memarena_alloc(struct MemArena *ma, int size) #if MEM_GNU_ATTRIBUTES +__attribute__((malloc)) __attribute__((warn_unused_result)) __attribute__((nonnull(1))) __attribute__((alloc_size(2))) -- cgit v1.2.3