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~