[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 0/2] Replaced locks with lock guard macros
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH v4 0/2] Replaced locks with lock guard macros |
Date: |
Mon, 23 Mar 2020 13:25:56 +0000 |
On Fri, Mar 20, 2020 at 06:43:23AM -0700, address@hidden wrote:
> /tmp/qemu-test/src/util/thread-pool.c:213:5: error: unused variable
> 'qemu_lockable_auto1' [-Werror,-Wunused-variable]
> QEMU_LOCK_GUARD(&pool->lock);
> ^
> /tmp/qemu-test/src/include/qemu/lockable.h:173:29: note: expanded from macro
> 'QEMU_LOCK_GUARD'
Apparently gcc suppresses "unused variable" warnings with g_autoptr() so
we didn't see this warning before.
clang does report them so let's silence the warning manually. Please
add G_GNUC_UNUSED onto the g_autoptr variable definition in the
QEMU_LOCK_GUARD() macro:
#define QEMU_LOCK_GUARD(x) \
g_autoptr(QemuLockable) qemu_lockable_auto##__COUNTER__ G_GNUC_UNUSED = \
qemu_lockable_auto_lock(QEMU_MAKE_LOCKABLE((x)))
The WITH_*_LOCK_GUARD() macros should not require changes because the
variable is both read and written.
You can test locally by building with clang (llvm) instead of gcc:
./configure --cc=clang
signature.asc
Description: PGP signature
- [PATCH v4 0/2] Replaced locks with lock guard macros, dnbrdsky, 2020/03/20
- [PATCH v4 1/2] lockable: fix __COUNTER__ macro to be referenced properly, dnbrdsky, 2020/03/20
- [PATCH v4 2/2] lockable: replaced locks with lock guard macros where appropriate, dnbrdsky, 2020/03/20
- Re: [PATCH v4 0/2] Replaced locks with lock guard macros, no-reply, 2020/03/20
- Re: [PATCH v4 0/2] Replaced locks with lock guard macros,
Stefan Hajnoczi <=
- Re: [PATCH v4 0/2] Replaced locks with lock guard macros, Daniel Brodsky, 2020/03/23
- Re: [PATCH v4 0/2] Replaced locks with lock guard macros, Richard Henderson, 2020/03/23
- Re: [PATCH v4 0/2] Replaced locks with lock guard macros, Eric Blake, 2020/03/24
- Re: [PATCH v4 0/2] Replaced locks with lock guard macros, Daniel Brodsky, 2020/03/25
- Re: [PATCH v4 0/2] Replaced locks with lock guard macros, Richard Henderson, 2020/03/26
- Re: [PATCH v4 0/2] Replaced locks with lock guard macros, Daniel Brodsky, 2020/03/28
- Re: [PATCH v4 0/2] Replaced locks with lock guard macros, Richard Henderson, 2020/03/28
- Re: [PATCH v4 0/2] Replaced locks with lock guard macros, Daniel Brodsky, 2020/03/30
- Re: [PATCH v4 0/2] Replaced locks with lock guard macros, Peter Maydell, 2020/03/30