[PATCH for-6.1? v2 1/9] nbd/server: Mark variable unused in nbd_negotiate_meta_queries

Richard Henderson posted 9 patches 4 years, 6 months ago
Maintainers: Eric Blake <eblake@redhat.com>, Laurent Vivier <laurent@vivier.eu>, Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>, David Gibson <david@gibson.dropbear.id.au>, Greg Kurz <groug@kaod.org>, Jason Wang <jasowang@redhat.com>, "Cédric Le Goater" <clg@kaod.org>
[PATCH for-6.1? v2 1/9] nbd/server: Mark variable unused in nbd_negotiate_meta_queries
Posted by Richard Henderson 4 years, 6 months ago
From clang-13:
nbd/server.c:976:22: error: variable 'bitmaps' set but not used \
    [-Werror,-Wunused-but-set-variable]

which is incorrect; see //bugs.llvm.org/show_bug.cgi?id=3888.

Cc: qemu-block@nongnu.org
Cc: Eric Blake <eblake@redhat.com>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 nbd/server.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/nbd/server.c b/nbd/server.c
index b60ebc3ab6..3927f7789d 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -973,7 +973,8 @@ static int nbd_negotiate_meta_queries(NBDClient *client,
 {
     int ret;
     g_autofree char *export_name = NULL;
-    g_autofree bool *bitmaps = NULL;
+    /* Mark unused to work around https://bugs.llvm.org/show_bug.cgi?id=3888 */
+    g_autofree G_GNUC_UNUSED bool *bitmaps = NULL;
     NBDExportMetaContexts local_meta = {0};
     uint32_t nb_queries;
     size_t i;
-- 
2.25.1


Re: [PATCH for-6.1? v2 1/9] nbd/server: Mark variable unused in nbd_negotiate_meta_queries
Posted by Vladimir Sementsov-Ogievskiy 4 years, 6 months ago
25.07.2021 15:24, Richard Henderson wrote:
>  From clang-13:
> nbd/server.c:976:22: error: variable 'bitmaps' set but not used \
>      [-Werror,-Wunused-but-set-variable]
> 
> which is incorrect; see //bugs.llvm.org/show_bug.cgi?id=3888.
> 
> Cc:qemu-block@nongnu.org
> Cc: Eric Blake<eblake@redhat.com>
> Cc: Vladimir Sementsov-Ogievskiy<vsementsov@virtuozzo.com>
> Signed-off-by: Richard Henderson<richard.henderson@linaro.org>

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

-- 
Best regards,
Vladimir

Re: [PATCH for-6.1? v2 1/9] nbd/server: Mark variable unused in nbd_negotiate_meta_queries
Posted by Eric Blake 4 years, 6 months ago
On Sun, Jul 25, 2021 at 02:24:08AM -1000, Richard Henderson wrote:
> From clang-13:
> nbd/server.c:976:22: error: variable 'bitmaps' set but not used \
>     [-Werror,-Wunused-but-set-variable]
> 
> which is incorrect; see //bugs.llvm.org/show_bug.cgi?id=3888.
> 
> Cc: qemu-block@nongnu.org
> Cc: Eric Blake <eblake@redhat.com>
> Cc: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  nbd/server.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/nbd/server.c b/nbd/server.c
> index b60ebc3ab6..3927f7789d 100644
> --- a/nbd/server.c
> +++ b/nbd/server.c
> @@ -973,7 +973,8 @@ static int nbd_negotiate_meta_queries(NBDClient *client,
>  {
>      int ret;
>      g_autofree char *export_name = NULL;
> -    g_autofree bool *bitmaps = NULL;
> +    /* Mark unused to work around https://bugs.llvm.org/show_bug.cgi?id=3888 */
> +    g_autofree G_GNUC_UNUSED bool *bitmaps = NULL;

Reviewed-by: Eric Blake <eblake@redhat.com>

I'm not sure this one patch warrants a pull request by itself, but I'm
not opposed to including it in 6.1 if anything also turns up affecting
NBD.  If someone wants to pick up the entire series, that would work
too.  Otherwise, I can queue this individual patch through my NBD tree
for 6.2.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org