[Mesa-dev] [PATCH] mesa/main: Fix missing return in non void function

Ian Romanick idr at freedesktop.org
Thu Aug 25 20:41:36 UTC 2016


On 08/25/2016 06:46 AM, Tobias Klausmann wrote:
> This was found by obs:
> I: Program returns random data in a function
> E: Mesa no-return-in-nonvoid-function main/program_resource.c:109
> 
> Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann at mni.thm.de>
> ---
>  src/mesa/main/program_resource.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/mesa/main/program_resource.c b/src/mesa/main/program_resource.c
> index 6ddbdad..a390866 100644
> --- a/src/mesa/main/program_resource.c
> +++ b/src/mesa/main/program_resource.c
> @@ -104,7 +104,7 @@ stage_from_program_interface(GLenum programInterface)
>     case GL_COMPUTE_SUBROUTINE_UNIFORM:
>        return MESA_SHADER_COMPUTE;
>     default:
> -      assert(!"unexpected programInterface value");
> +      unreachable(!"unexpected programInterface value");
                     ^ Remove the !

I'm surprised this doesn't generate additional warnings since the
parameter in unreachable is expected to be string.  With that fixed,
this patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

>     }
>  }
>  
> 



More information about the mesa-dev mailing list