On 9/10/23 12:26, Markus Armbruster wrote:
Philippe Mathieu-Daudé <phi...@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