qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 01/11] nbd/server: Remove unused variable


From: Richard Henderson
Subject: Re: [PATCH 01/11] nbd/server: Remove unused variable
Date: Tue, 13 Jul 2021 06:54:31 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 7/13/21 6:14 AM, Eric Blake wrote:
Hmm; in glib 2.68.2 (on Fedora 34), g_autofree does NOT include an
attribute unused.  Thus, does this silence the compiler?  (Even cooler
would be making the comment a link to an actual bug in the clang
database, but I couldn't quickly find one)

diff --git i/nbd/server.c w/nbd/server.c
index b60ebc3ab6ac..393cbd81c57a 100644
--- i/nbd/server.c
+++ w/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;
+    /* G_GNUC_UNUSED needed to work around a clang bug */
+    g_autofree G_GNUC_UNUSED bool *bitmaps = NULL;

That works.  I found

  https://bugs.llvm.org/show_bug.cgi?id=3888

and gave it a nudge.


r~



reply via email to

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