[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 01/66] util: Suppress -Wstringop-overflow in qemu_thread_start
From: |
Richard Henderson |
Subject: |
[PATCH v3 01/66] util: Suppress -Wstringop-overflow in qemu_thread_start |
Date: |
Wed, 18 Aug 2021 09:18:15 -1000 |
This seems to be either a glibc or gcc bug, but the code
appears to be fine with the warning suppressed.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
util/qemu-thread-posix.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c
index fd9d714038..6c5004220d 100644
--- a/util/qemu-thread-posix.c
+++ b/util/qemu-thread-posix.c
@@ -537,9 +537,28 @@ static void *qemu_thread_start(void *args)
QEMU_TSAN_ANNOTATE_THREAD_NAME(qemu_thread_args->name);
g_free(qemu_thread_args->name);
g_free(qemu_thread_args);
+
+ /*
+ * GCC 11 with glibc 2.17 on PowerPC reports
+ *
+ * qemu-thread-posix.c:540:5: error: ‘__sigsetjmp’ accessing 656 bytes
+ * in a region of size 528 [-Werror=stringop-overflow=]
+ * 540 | pthread_cleanup_push(qemu_thread_atexit_notify, NULL);
+ * | ^~~~~~~~~~~~~~~~~~~~
+ *
+ * which is clearly nonsense.
+ */
+#pragma GCC diagnostic push
+#ifndef __clang__
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
+#endif
+
pthread_cleanup_push(qemu_thread_atexit_notify, NULL);
r = start_routine(arg);
pthread_cleanup_pop(1);
+
+#pragma GCC diagnostic pop
+
return r;
}
--
2.25.1
- [PATCH v3 00/66] Unaligned access for user-only, Richard Henderson, 2021/08/18
- [PATCH v3 01/66] util: Suppress -Wstringop-overflow in qemu_thread_start,
Richard Henderson <=
- [PATCH v3 02/66] hw/core: Make do_unaligned_access noreturn, Richard Henderson, 2021/08/18
- [PATCH v3 03/66] hw/core: Make do_unaligned_access available to user-only, Richard Henderson, 2021/08/18
- [PATCH v3 04/66] target/alpha: Implement do_unaligned_access for user-only, Richard Henderson, 2021/08/18
- [PATCH v3 05/66] target/arm: Implement do_unaligned_access for user-only, Richard Henderson, 2021/08/18
- [PATCH v3 06/66] target/hppa: Implement do_unaligned_access for user-only, Richard Henderson, 2021/08/18
- [PATCH v3 09/66] target/ppc: Move SPR_DSISR setting to powerpc_excp, Richard Henderson, 2021/08/18