[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug 1886155] Re: error: argument 2 of ‘__atomic_load’ discards ‘const’
From: |
Jonathan Wakely |
Subject: |
[Bug 1886155] Re: error: argument 2 of ‘__atomic_load’ discards ‘const’ qualifier |
Date: |
Wed, 19 Aug 2020 10:36:53 -0000 |
It looks like `typeof_strip_qual` doesn't work for pointer types.
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1886155
Title:
error: argument 2 of ‘__atomic_load’ discards ‘const’ qualifier
Status in QEMU:
New
Bug description:
GCC 11 reports the following errors:
[ 125s] In file included from
/home/abuild/rpmbuild/BUILD/qemu-5.0.0/include/qemu/seqlock.h:17,
[ 125s] from
/home/abuild/rpmbuild/BUILD/qemu-5.0.0/include/qemu/qht.h:10,
[ 125s] from
/home/abuild/rpmbuild/BUILD/qemu-5.0.0/util/qht.c:69:
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/util/qht.c: In function
'qht_do_lookup':
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/include/qemu/atomic.h:153:5:
error: argument 2 of '__atomic_load' discards 'const' qualifier
[-Werror=incompatible-pointer-types]
[ 125s] 153 | __atomic_load(ptr, valptr, __ATOMIC_RELAXED); \
[ 125s] | ^~~~~~~~~~~~~
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/include/qemu/atomic.h:161:5:
note: in expansion of macro 'atomic_rcu_read__nocheck'
[ 125s] 161 | atomic_rcu_read__nocheck(ptr, &_val); \
[ 125s] | ^~~~~~~~~~~~~~~~~~~~~~~~
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/util/qht.c:499:27: note: in
expansion of macro 'atomic_rcu_read'
[ 125s] 499 | void *p = atomic_rcu_read(&b->pointers[i]);
[ 125s] | ^~~~~~~~~~~~~~~
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/include/qemu/atomic.h:153:5:
error: argument 2 of '__atomic_load' discards 'const' qualifier
[-Werror=incompatible-pointer-types]
[ 125s] 153 | __atomic_load(ptr, valptr, __ATOMIC_RELAXED); \
[ 125s] | ^~~~~~~~~~~~~
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/include/qemu/atomic.h:161:5:
note: in expansion of macro 'atomic_rcu_read__nocheck'
[ 125s] 161 | atomic_rcu_read__nocheck(ptr, &_val); \
[ 125s] | ^~~~~~~~~~~~~~~~~~~~~~~~
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/util/qht.c:506:13: note: in
expansion of macro 'atomic_rcu_read'
[ 125s] 506 | b = atomic_rcu_read(&b->next);
[ 125s] | ^~~~~~~~~~~~~~~
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/util/qht.c: In function
'qht_lookup_custom':
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/include/qemu/atomic.h:153:5:
error: argument 2 of '__atomic_load' discards 'const' qualifier
[-Werror=incompatible-pointer-types]
[ 125s] 153 | __atomic_load(ptr, valptr, __ATOMIC_RELAXED); \
[ 125s] | ^~~~~~~~~~~~~
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/include/qemu/atomic.h:161:5:
note: in expansion of macro 'atomic_rcu_read__nocheck'
[ 125s] 161 | atomic_rcu_read__nocheck(ptr, &_val); \
[ 125s] | ^~~~~~~~~~~~~~~~~~~~~~~~
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/util/qht.c:534:11: note: in
expansion of macro 'atomic_rcu_read'
[ 125s] 534 | map = atomic_rcu_read(&ht->map);
[ 125s] | ^~~~~~~~~~~~~~~
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/util/qht.c: In function
'qht_statistics_init':
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/include/qemu/atomic.h:153:5:
error: argument 2 of '__atomic_load' discards 'const' qualifier
[-Werror=incompatible-pointer-types]
[ 125s] 153 | __atomic_load(ptr, valptr, __ATOMIC_RELAXED); \
[ 125s] | ^~~~~~~~~~~~~
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/include/qemu/atomic.h:161:5:
note: in expansion of macro 'atomic_rcu_read__nocheck'
[ 125s] 161 | atomic_rcu_read__nocheck(ptr, &_val); \
[ 125s] | ^~~~~~~~~~~~~~~~~~~~~~~~
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/util/qht.c:907:11: note: in
expansion of macro 'atomic_rcu_read'
[ 125s] 907 | map = atomic_rcu_read(&ht->map);
[ 125s] | ^~~~~~~~~~~~~~~
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/include/qemu/atomic.h:153:5:
error: argument 2 of '__atomic_load' discards 'const' qualifier
[-Werror=incompatible-pointer-types]
[ 125s] 153 | __atomic_load(ptr, valptr, __ATOMIC_RELAXED); \
[ 125s] | ^~~~~~~~~~~~~
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/include/qemu/atomic.h:161:5:
note: in expansion of macro 'atomic_rcu_read__nocheck'
[ 125s] 161 | atomic_rcu_read__nocheck(ptr, &_val); \
[ 125s] | ^~~~~~~~~~~~~~~~~~~~~~~~
[ 125s] /home/abuild/rpmbuild/BUILD/qemu-5.0.0/util/qht.c:941:21: note: in
expansion of macro 'atomic_rcu_read'
[ 125s] 941 | b = atomic_rcu_read(&b->next);
[ 125s] | ^~~~~~~~~~~~~~~
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1886155/+subscriptions