https://llvm.org/bugs/show_bug.cgi?id=22949

            Bug ID: 22949
           Summary: glibc 2.20 WIFCONTINUED raises a
                    -Wparentheses-equality warning
           Product: clang
           Version: 3.5
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

It complains about extra parentheses around comparison, however no such thing
exists in the source -- the warning concerns the expanded macros:

[lkundrak@belphegor NetworkManager]$ clang -Werror -Wparentheses-equality
-Wno-unused -c feh.c
feh.c:2:99: error: equality comparison with extraneous parentheses
[-Werror,-Wparentheses-equality]
void f () { if ((((__extension__ (((union { __typeof(0) __in; int __i; }) {
.__in = (0) }).__i))) == 0xffff)) return; }
                
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
feh.c:2:99: note: remove extraneous parentheses around the comparison to
silence this warning
void f () { if ((((__extension__ (((union { __typeof(0) __in; int __i; }) {
.__in = (0) }).__i))) == 0xffff)) return; }
                ~                                                              
                  ^        ~
feh.c:2:99: note: use '=' to turn this equality comparison into an assignment
void f () { if ((((__extension__ (((union { __typeof(0) __in; int __i; }) {
.__in = (0) }).__i))) == 0xffff)) return; }
                                                                               
                  ^~
                                                                               
                  =
1 error generated.
[lkundrak@belphegor NetworkManager]$ cat feh.c 
#include <sys/wait.h>
void f () { if (WIFCONTINUED(0)) return; }
[lkundrak@belphegor NetworkManager]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to