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: Philippe Mathieu-Daudé
Subject: Re: [PATCH] system/vl: Use global &bdo_queue in configure_blockdev()
Date: Mon, 9 Oct 2023 13:54:50 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1

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.



reply via email to

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