]> xenbits.xensource.com Git - people/royger/xen.git/commit
clang: disable the gcc-compat warnings for read_atomic fix_clang gitlab/fix_clang
authorRoger Pau Monne <roger.pau@citrix.com>
Mon, 10 Apr 2017 15:12:12 +0000 (16:12 +0100)
committerRoger Pau Monne <roger.pau@citrix.com>
Mon, 10 Apr 2017 16:47:06 +0000 (17:47 +0100)
commit323306d175e9e2a86a47f3d0e1bd70ff430a696a
tree883b6ed432d61125d3fb2d7376acfe13b67bd47f
parent17cd6621688bce9972d9242611114fd7aba44c31
clang: disable the gcc-compat warnings for read_atomic

clang gcc-compat warnings can wrongly fire when certain constructions are used,
at least the following flow:

switch ( ... )
{
case ...:
    while ( ({ int x; switch ( foo ) { case 1: x = 1; break; } x }) )
    {
        ...

Will cause clang to emit the following warning "'break' is bound to loop, GCC
binds it to switch", which is a false positive, and both gcc and clang bound
the break to the inner switch. In order to workaround this issue, disable the
gcc-compat checks for the usage of the read_atomic macro.

This has been reported upstream as http://bugs.llvm.org/show_bug.cgi?id=32595.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
xen/include/asm-x86/atomic.h
xen/include/xen/compiler.h