[Mesa-dev] [PATCH] Android: enable noreturn and returns_nonnull attributes

Jason Ekstrand jason at jlekstrand.net
Tue Dec 5 02:44:06 UTC 2017


Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Mon, Dec 4, 2017 at 6:21 PM, Rob Herring <robh at kernel.org> wrote:

> 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, so add it too.
>
> Fixes: 94ca8e04adf6 ("spirv: Add vtn_fail and vtn_assert helpers")
> Cc: Jason Ekstrand <jason.ekstrand at intel.com>
> Signed-off-by: Rob Herring <robh at kernel.org>
> ---
>  Android.common.mk | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/Android.common.mk b/Android.common.mk
> index f080d996a7d9..f905c5e697d0 100644
> --- a/Android.common.mk
> +++ b/Android.common.mk
> @@ -57,6 +57,8 @@ LOCAL_CFLAGS += \
>         -DHAVE_FUNC_ATTRIBUTE_FORMAT \
>         -DHAVE_FUNC_ATTRIBUTE_PACKED \
>         -DHAVE_FUNC_ATTRIBUTE_ALIAS \
> +       -DHAVE_FUNC_ATTRIBUTE_NORETURN \
> +       -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL \
>         -DHAVE___BUILTIN_CTZ \
>         -DHAVE___BUILTIN_POPCOUNT \
>         -DHAVE___BUILTIN_POPCOUNTLL \
> --
> 2.14.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171204/56da73b7/attachment.html>


More information about the mesa-dev mailing list