|
| From: | Paolo Bonzini |
| Subject: | Re: [PATCH for-8.0 1/3] async: Suppress GCC13 false positive in aio_bh_poll() |
| Date: | Tue, 21 Mar 2023 14:02:35 +0100 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 |
On 3/21/23 13:16, Cédric Le Goater wrote:
+ /*
+ * GCC13 [-Werror=dangling-pointer=] complains that the local variable
+ * 'slice' is being stored in the global list 'ctx->bh_slice_list'.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdangling-pointer="
QSIMPLEQ_INSERT_TAIL(&ctx->bh_slice_list, &slice, next);
+#pragma GCC diagnostic pop
while ((s = QSIMPLEQ_FIRST(&ctx->bh_slice_list))) {
QEMUBH *bh;
Yeah, that's clearer. Maybe even add "but the list is emptied before this function returns".
May be that's more explicit. I wonder if we need to ifdef clang also.
I think clang understand the GCC pragma as well. Paolo
| [Prev in Thread] | Current Thread | [Next in Thread] |