[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] hw/virtio/virtio-gpu: Fix compiler warning when compiling
|
From: |
Markus Armbruster |
|
Subject: |
Re: [PATCH v2] hw/virtio/virtio-gpu: Fix compiler warning when compiling with -Wshadow |
|
Date: |
Thu, 12 Oct 2023 08:08:43 +0200 |
|
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Thomas Huth <thuth@redhat.com> writes:
> Avoid using trivial variable names in macros, otherwise we get
> the following compiler warning when compiling with -Wshadow=local:
>
> In file included from ../../qemu/hw/display/virtio-gpu-virgl.c:19:
> ../../home/thuth/devel/qemu/hw/display/virtio-gpu-virgl.c:
> In function ‘virgl_cmd_submit_3d’:
> ../../qemu/include/hw/virtio/virtio-gpu.h:228:16: error: declaration of ‘s’
> shadows a previous local [-Werror=shadow=compatible-local]
> 228 | size_t s;
> | ^
> ../../qemu/hw/display/virtio-gpu-virgl.c:215:5: note: in expansion of macro
> ‘VIRTIO_GPU_FILL_CMD’
> 215 | VIRTIO_GPU_FILL_CMD(cs);
> | ^~~~~~~~~~~~~~~~~~~
> ../../qemu/hw/display/virtio-gpu-virgl.c:213:12: note: shadowed declaration
> is here
> 213 | size_t s;
> | ^
> cc1: all warnings being treated as errors
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
Queued. Thanks!