Skip to content

Commit 37daf1b

Browse files
rth7680bonzini
authored andcommitted
util: Suppress -Wstringop-overflow in qemu_thread_start
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 <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent bf21fe9 commit 37daf1b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

util/qemu-thread-posix.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,28 @@ static void *qemu_thread_start(void *args)
537537
QEMU_TSAN_ANNOTATE_THREAD_NAME(qemu_thread_args->name);
538538
g_free(qemu_thread_args->name);
539539
g_free(qemu_thread_args);
540+
541+
/*
542+
* GCC 11 with glibc 2.17 on PowerPC reports
543+
*
544+
* qemu-thread-posix.c:540:5: error: ‘__sigsetjmp’ accessing 656 bytes
545+
* in a region of size 528 [-Werror=stringop-overflow=]
546+
* 540 | pthread_cleanup_push(qemu_thread_atexit_notify, NULL);
547+
* | ^~~~~~~~~~~~~~~~~~~~
548+
*
549+
* which is clearly nonsense.
550+
*/
551+
#pragma GCC diagnostic push
552+
#ifndef __clang__
553+
#pragma GCC diagnostic ignored "-Wstringop-overflow"
554+
#endif
555+
540556
pthread_cleanup_push(qemu_thread_atexit_notify, NULL);
541557
r = start_routine(arg);
542558
pthread_cleanup_pop(1);
559+
560+
#pragma GCC diagnostic pop
561+
543562
return r;
544563
}
545564

0 commit comments

Comments
 (0)