qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] system/vl: Use global &bdo_queue in configure_blockdev()


From: Markus Armbruster
Subject: Re: [PATCH] system/vl: Use global &bdo_queue in configure_blockdev()
Date: Mon, 09 Oct 2023 14:41:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> On 9/10/23 12:26, Markus Armbruster wrote:
>> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>> 
>>> Commit d11bf9bf0f ("vl: Factor configure_blockdev() out of main()")
>>> passed &bdo_queue as argument, but this isn't really necessary since
>>> there is only one call, so we still use the global variable.
>>>
>>> Dropping the &bdo_queue argument allows to silence this global shadow
>>> warning:
>>>
>>>    softmmu/vl.c:678:54: error: declaration shadows a variable in the global 
>>> scope [-Werror,-Wshadow]
>>>    static void configure_blockdev(BlockdevOptionsQueue *bdo_queue,
>>>                                                         ^
>>>    softmmu/vl.c:172:29: note: previous declaration is here
>>>    static BlockdevOptionsQueue bdo_queue = 
>>> QSIMPLEQ_HEAD_INITIALIZER(bdo_queue);
>> Not sure this is an improvement.  Up to Paolo, I guess.
>
> Any alternative suggestion? I'm looking at enabling -Wshadow with Clang
> to avoid Clang users not getting the -Wshadow=local warnings until a
> maintainer test their patches on CI.

Rename to @bdos?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]