Android: enable noreturn and returns_nonnull attributes

Graphics / Mesa 3D Graphics Library / Mesa - Rob Herring [kernel.org] - 5 December 2017 13:47 EST

Commit 94ca8e04adf6 ("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: 94ca8e04adf6 ("spirv: Add vtn_fail and vtn_assert helpers") Cc: Jason Ekstrand

20d37da597 Android: enable noreturn and returns_nonnull attributes
Android.common.mk | 3 +++
1 file changed, 3 insertions(+)

Upstream: cgit.freedesktop.org


  • Share