[Mesa-dev] [PATCH] intel/compiler: fix return statement warning in brw_regs_negative_equal()
Brian Paul
brianp at vmware.com
Thu Mar 29 15:49:32 UTC 2018
On 03/29/2018 03:49 AM, Emil Velikov wrote:
> Hi Brian,
>
> On 29 March 2018 at 02:48, Brian Paul <brianp at vmware.com> wrote:
>> Silence a gcc warning about missing return value in non-void function.
>> For some reason, gcc 5.4.0 (at least) can't deduce that all else/if
>> cases return a value.
>
> A small brain dump:
>
> Guessing that's because of the unreachable() cases at the end of the
> if (a->file == IMM) branch.
Yeah, that's what I thought too. But if I comment out the unreachable()
statement and put 'return false' in its place, I still get the warning.
> Ideally we'll update the macro to make things more obvious for the
> compiler. Otherwise we'll have to update dozens of similar instances
> through the code base.
I don't think this particular issue is caused by unreachable().
-Brian
More information about the mesa-dev
mailing list