Paolo Bonzini 5927ed846a atomic: strip "const" from variables declared with typeof
With the latest clang, we have the following warning:

    /home/pranith/devops/code/qemu/include/qemu/seqlock.h:62:21: warning: passing 'typeof (*&sl->sequence) *' (aka 'const unsigned int *') to parameter of type 'unsigned int *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        return unlikely(atomic_read(&sl->sequence) != start);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/pranith/devops/code/qemu/include/qemu/atomic.h:58:25: note: expanded from macro 'atomic_read'
        __atomic_load(ptr, &_val, __ATOMIC_RELAXED);     \
                           ^~~~~

Stripping const is a bit tricky due to promotions, but it is doable
with either C11 _Generic or GCC extensions.  Use the latter.

Reported-by: Pranith Kumar <bobby.prani@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[pranith: Add conversion for bool type]
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-08-09 22:57:36 +02:00
..
2016-07-04 13:15:22 +01:00
2016-02-23 12:43:05 +00:00
2016-06-07 18:19:23 +03:00
2016-02-23 12:43:05 +00:00
2016-02-23 12:43:05 +00:00
2016-06-16 18:39:03 +02:00
2016-06-07 18:19:24 +03:00
2014-03-13 14:42:21 +01:00
2016-08-02 12:03:58 +02:00
2016-02-23 12:43:05 +00:00
2016-02-23 12:43:05 +00:00
2016-02-23 12:43:05 +00:00