[Bf-blender-cvs] [bb4e09ddc56] master: Fix compiler warnings with clang

Brecht Van Lommel noreply at git.blender.org
Wed Sep 28 16:03:45 CEST 2022


Commit: bb4e09ddc565b96684e280323cf4afcc2d39986f
Author: Brecht Van Lommel
Date:   Wed Sep 28 15:49:26 2022 +0200
Branches: master
https://developer.blender.org/rBbb4e09ddc565b96684e280323cf4afcc2d39986f

Fix compiler warnings with clang

This attribute only works on functions in clang, not function pointers.

===================================================================

M	source/blender/blenlib/BLI_compiler_attrs.h

===================================================================

diff --git a/source/blender/blenlib/BLI_compiler_attrs.h b/source/blender/blenlib/BLI_compiler_attrs.h
index 9ee626296cb..f0566e0b3e2 100644
--- a/source/blender/blenlib/BLI_compiler_attrs.h
+++ b/source/blender/blenlib/BLI_compiler_attrs.h
@@ -46,7 +46,7 @@
 #endif
 
 /* the function return value points to memory (2 args for 'size * tot') */
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__clang__)
 #  define ATTR_ALLOC_SIZE(args...) __attribute__((alloc_size(args)))
 #else
 #  define ATTR_ALLOC_SIZE(...)



More information about the Bf-blender-cvs mailing list