[Mesa-dev] [PATCH] i965: Fix shadowing of 'height' parameter

Emil Velikov emil.l.velikov at gmail.com
Wed May 25 17:00:41 UTC 2016


On 25 May 2016 at 17:33, Kristian Høgsberg <krh at bitplanet.net> wrote:
> From: Kristian Høgsberg Kristensen <krh at bitplanet.net>
>
> The nested declaration of 'height' shadows a parameter and uses
> uninitialized memory. Fix by renaming to 'plane_height' which also makes
> the code clearer.
>
> This would typically break the bo size computation, but we don't use
> that except when mmaping, and we don't mmap YUV buffers much.
>
Perhaps we should just enable -Wshadow ? IIRC there were ~100 warnings
for C files and ~6000 for C++. We could fix the former relatively
quick and leave the C++ one disabled for now.

-Emil


More information about the mesa-dev mailing list