qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 1/3] util/qemu-thread-posix: use TSA_NO_TSA to suppress clang


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 1/3] util/qemu-thread-posix: use TSA_NO_TSA to suppress clang TSA warnings
Date: Tue, 17 Jan 2023 16:49:11 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1

On 17/1/23 15:43, Emanuele Giuseppe Esposito wrote:


Am 17/01/2023 um 15:33 schrieb Philippe Mathieu-Daudé:
On 17/1/23 14:52, Emanuele Giuseppe Esposito wrote:
QEMU does not compile when enabling clang's thread safety analysis
(TSA),
because some functions create wrappers for pthread mutexes but do
not use any TSA macro. Therefore the compiler fails.

In order to make the compiler happy and avoid adding all the
necessary macros to all callers (lock functions should use
TSA_ACQUIRE, while unlock TSA_RELEASE, and this applies to all
users of pthread_mutex_lock/pthread_mutex_unlock),
simply use TSA_NO_TSA to supppress such warnings.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
   include/qemu/thread.h    | 14 +++++++++-----
   util/qemu-thread-posix.c |  2 +-
   2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/include/qemu/thread.h b/include/qemu/thread.h
index 7c6703bce3..81ec9fc144 100644
--- a/include/qemu/thread.h
+++ b/include/qemu/thread.h
@@ -3,6 +3,7 @@
     #include "qemu/processor.h"
   #include "qemu/atomic.h"
+#include "qemu/clang-tsa.h"

Missing file?     ^^^^^^^^^^

? Forgot to pull latest changes? I see clang-tsa.h in master

Oops sorry I forgot to reset a git-bisection, and indeed was
based on a older base :\




reply via email to

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