Commit 20d37da5 authored by Rob Herring's avatar Rob Herring

Android: enable noreturn and returns_nonnull attributes

Commit 94ca8e04 ("spirv: Add vtn_fail and vtn_assert helpers") broke
Android builds which have -Werror enabled with the following errors:

external/mesa3d/src/compiler/spirv/spirv_to_nir.c:272:1: error: control may reach end of non-void function [-Werror,-Wreturn-type]
external/mesa3d/src/compiler/spirv/spirv_to_nir.c:810:1: error: control may reach end of non-void function [-Werror,-Wreturn-type]
...

The problem is the noreturn attribute is not enabled and we to define
HAVE_FUNC_ATTRIBUTE_NORETURN.

Auditing src/util/macros.h, we're also missing
HAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL and HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT,
so add them too.

Fixes: 94ca8e04 ("spirv: Add vtn_fail and vtn_assert helpers")
Cc: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
Reviewed-by: default avatarEmil Velikov <emil.velikov@collabora.com>
Signed-off-by: Rob Herring's avatarRob Herring <robh@kernel.org>
parent dbad0acf
......@@ -57,6 +57,9 @@ LOCAL_CFLAGS += \
-DHAVE_FUNC_ATTRIBUTE_FORMAT \
-DHAVE_FUNC_ATTRIBUTE_PACKED \
-DHAVE_FUNC_ATTRIBUTE_ALIAS \
-DHAVE_FUNC_ATTRIBUTE_NORETURN \
-DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL \
-DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT \
-DHAVE___BUILTIN_CTZ \
-DHAVE___BUILTIN_POPCOUNT \
-DHAVE___BUILTIN_POPCOUNTLL \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment