<p dir="ltr"><br>
On Jan 4, 2016 8:30 PM, "Ilia Mirkin" <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>> wrote:<br>
><br>
> gcc 4.9.3 shows the following error:<br>
><br>
> brw_vue_map.c:260:20: warning: array subscript is above array bounds<br>
> [-Warray-bounds]<br>
> return brw_names[slot - VARYING_SLOT_MAX];<br>
><br>
> This is because BRW_VARYING_SLOT_COUNT is a valid value for the enum<br>
> type. Adding an assert will generate no additional code but will teach<br>
> the compiler to not complain.</p>
<p dir="ltr">What of you build in release mode?</p>
<p dir="ltr">> Signed-off-by: Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>><br>
> ---<br>
> src/mesa/drivers/dri/i965/brw_vue_map.c | 1 +<br>
> 1 file changed, 1 insertion(+)<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/brw_vue_map.c b/src/mesa/drivers/dri/i965/brw_vue_map.c<br>
> index 09eadbc..fea2436 100644<br>
> --- a/src/mesa/drivers/dri/i965/brw_vue_map.c<br>
> +++ b/src/mesa/drivers/dri/i965/brw_vue_map.c<br>
> @@ -257,6 +257,7 @@ varying_name(brw_varying_slot slot)<br>
> [BRW_VARYING_SLOT_PNTC - VARYING_SLOT_MAX] = "BRW_VARYING_SLOT_PNTC",<br>
> };<br>
><br>
> + assert(slot < BRW_VARYING_SLOT_COUNT);<br>
> return brw_names[slot - VARYING_SLOT_MAX];<br>
> }<br>
><br>
> --<br>
> 2.4.10<br>
><br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</p>