[Mesa-stable] [PATCH 4/4] glsl: Fix no return value for non-void function

Emil Velikov emil.l.velikov at gmail.com
Sat Sep 27 07:40:42 PDT 2014


On 27/09/14 15:20, Tomasz Figa wrote:
> Even though scope outside the switch statement is unreachable, the
> compiler generates a warning, which is treated as error by Android
> toolchain. Fix the issue by adding dummy return statement.
> 
I fear that other may have a preference to fix the compiler/build
toolchain rather than adding the return here.
Did you manage to find any form of detection for the builtins ?
Otherwise one might just set the define HAVE___BUILTIN_UNREACHABLE.

Cheers,
-Emil

> Signed-off-by: Tomasz Figa <tomasz.figa at gmail.com>
> CC: <mesa-stable at lists.freedesktop.org>
> ---
>  src/glsl/opt_vectorize.cpp | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/glsl/opt_vectorize.cpp b/src/glsl/opt_vectorize.cpp
> index 2f71a83583b1..066e15a66447 100644
> --- a/src/glsl/opt_vectorize.cpp
> +++ b/src/glsl/opt_vectorize.cpp
> @@ -229,6 +229,7 @@ write_mask_to_swizzle(unsigned write_mask)
>     case WRITEMASK_W: return SWIZZLE_W;
>     }
>     unreachable("not reached");
> +   return 0;
>  }
>  
>  /**
> 



More information about the mesa-stable mailing list