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

Alejandro Piñeiro apinheiro at igalia.com
Fri Aug 26 06:44:31 UTC 2016


On 26/08/16 08:38, Alejandro Piñeiro wrote:
> On 25/08/16 22:38, Ian Romanick wrote:
>> On 08/25/2016 08:19 AM, Emil Velikov wrote:
>>> On 25 August 2016 at 13:24, Francesco Ansanelli <francians at gmail.com> wrote:
>>>> Signed-off-by: Francesco Ansanelli <francians at gmail.com>
>>>> ---
>>>>  src/mesa/main/program_resource.c |    1 +
>>>>  1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/src/mesa/main/program_resource.c b/src/mesa/main/program_resource.c
>>>> index 6ddbdad..51dbe95 100644
>>>> --- a/src/mesa/main/program_resource.c
>>>> +++ b/src/mesa/main/program_resource.c
>>>> @@ -105,6 +105,7 @@ stage_from_program_interface(GLenum programInterface)
>>>>        return MESA_SHADER_COMPUTE;
>>>>     default:
>>>>        assert(!"unexpected programInterface value");
>>>> +      return -1;
>>> This should be unreachable() since programInterface is validated
>>> further up the stack by is_subroutine_uniform_program_interface().
>>
>> I was going to say the same thing.
> 
> Good point. Francesco do you mind write a new patch replacing assert for
> unreachable (so return -1 would not be needed)?

Well, Tobias Klausmann already did that. So sorry, your patch would be
dropped.

And again, thanks for the original patch.

BR

-- 
Alejandro Piñeiro <apinheiro at igalia.com>


More information about the mesa-dev mailing list