util: Disable usage of __attribute__((__const__)) when the compiler is clang
Clang didn't implement __attribute__((__const__)) properly for release build. The issue tracker is: https://github.com/llvm/llvm-project/issues/56993 Closes #6781 Closes #6782 Closes #7170 Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18798>
This commit is contained in:
@@ -140,7 +140,7 @@ do { \
|
||||
* value. As a result, calls to it can be CSEed. Note that using memory
|
||||
* pointed to by the arguments is not allowed for const functions.
|
||||
*/
|
||||
#ifdef HAVE_FUNC_ATTRIBUTE_CONST
|
||||
#if !defined(__clang__) && defined(HAVE_FUNC_ATTRIBUTE_CONST)
|
||||
#define ATTRIBUTE_CONST __attribute__((__const__))
|
||||
#else
|
||||
#define ATTRIBUTE_CONST
|
||||
|
Reference in New Issue
Block a user