qemu-devel
[Top][All Lists]
Advanced

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

Warning on Fedora 38


From: Juan Quintela
Subject: Warning on Fedora 38
Date: Tue, 25 Apr 2023 13:36:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Hi

I got this warning/error when switching to F38:

In file included from /mnt/code/qemu/full/include/block/aio.h:21,
                 from ../../../../mnt/code/qemu/full/util/async.c:28:
../../../../mnt/code/qemu/full/util/async.c: In function ‘aio_bh_poll’:
/mnt/code/qemu/full/include/qemu/queue.h:303:22: error: storing the address of 
local variable ‘slice’ in ‘*ctx.bh_slice_list.sqh_last’ 
[-Werror=dangling-pointer=]
  303 |     (head)->sqh_last = &(elm)->field.sqe_next;                          
\
      |     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
../../../../mnt/code/qemu/full/util/async.c:167:5: note: in expansion of macro 
‘QSIMPLEQ_INSERT_TAIL’
  167 |     QSIMPLEQ_INSERT_TAIL(&ctx->bh_slice_list, &slice, next);
      |     ^~~~~~~~~~~~~~~~~~~~
../../../../mnt/code/qemu/full/util/async.c:161:17: note: ‘slice’ declared here
  161 |     BHListSlice slice;
      |                 ^~~~~
../../../../mnt/code/qemu/full/util/async.c:161:17: note: ‘ctx’ declared here
cc1: all warnings being treated as errors

compiler is right that slice is a local variable.
on the other hand, I *think* that the list is fully consumed on that
function, so this shouldn't be a problem.

g_new() is a posibility.
I can't think of an easy way to convince gcc that using a local varible
there is correct.

How to go from here?  Any good ideas?

Later, Juan.




reply via email to

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