diff options
Diffstat (limited to 'suppress-gcc13-warning.patch')
-rw-r--r-- | suppress-gcc13-warning.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/suppress-gcc13-warning.patch b/suppress-gcc13-warning.patch new file mode 100644 index 000000000000..5d0b95248b2b --- /dev/null +++ b/suppress-gcc13-warning.patch @@ -0,0 +1,26 @@ +diff --git a/util/async.c b/util/async.c +index 21016a1ac7..856e1a8a33 100644 +--- a/util/async.c ++++ b/util/async.c +@@ -164,7 +164,21 @@ int aio_bh_poll(AioContext *ctx) + + /* Synchronizes with QSLIST_INSERT_HEAD_ATOMIC in aio_bh_enqueue(). */ + QSLIST_MOVE_ATOMIC(&slice.bh_list, &ctx->bh_list); ++ ++ /* ++ * GCC13 [-Werror=dangling-pointer=] complains that the local variable ++ * 'slice' is being stored in the global 'ctx->bh_slice_list' but the ++ * list is emptied before this function returns. ++ */ ++#if !defined(__clang__) ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wpragmas" ++#pragma GCC diagnostic ignored "-Wdangling-pointer=" ++#endif + QSIMPLEQ_INSERT_TAIL(&ctx->bh_slice_list, &slice, next); ++#if !defined(__clang__) ++#pragma GCC diagnostic pop ++#endif + + while ((s = QSIMPLEQ_FIRST(&ctx->bh_slice_list))) { + QEMUBH *bh; |