From 20d37da597653201d2c524434907e817bd03b1d0 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Mon, 4 Dec 2017 18:35:48 -0600 Subject: [PATCH] Android: enable noreturn and returns_nonnull attributes 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 Reviewed-by: Jason Ekstrand Reviewed-by: Emil Velikov Signed-off-by: Rob Herring --- Android.common.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Android.common.mk b/Android.common.mk index fcd9a874d53..103e3fec615 100644 --- a/Android.common.mk +++ b/Android.common.mk @@ -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 \ -- 2.30.2