Re: Build regressions/improvements in v6.2-rc4

From: Guenter Roeck
Date: Mon Jan 16 2023 - 13:50:47 EST


On Mon, Jan 16, 2023 at 01:29:24PM +0100, Geert Uytterhoeven wrote:
> Below is the list of build error/warning regressions/improvements in
> v6.2-rc4[1] compared to v6.1[2].
>
...
> + /kisskb/src/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c: error: array subscript 2 is above array bounds of 'u32[2]' {aka 'unsigned int[2]'} [-Werror=array-bounds]: => 641:28
> + /kisskb/src/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c: error: array subscript 3 is above array bounds of 'u32[2]' {aka 'unsigned int[2]'} [-Werror=array-bounds]: => 641:28

Unless I am missing something, the code is

for (i = fmt->mem_planes; i < fmt->comp_planes; i++)
size += q_data->sizeimage[i];

and both mem_planes and comp_planes are <= 2. How does the compiler
calculate an error subscript of 2/3 ?

Guenter