[LLVMbugs] [Bug 22949] New: glibc 2.20 WIFCONTINUED raises a -Wparentheses-equality warning

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 18 09:32:44 PDT 2015


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: unassignedclangbugs at nondot.org
          Reporter: lkundrak at v3.sk
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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

[lkundrak at 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 at belphegor NetworkManager]$ cat feh.c 
#include <sys/wait.h>
void f () { if (WIFCONTINUED(0)) return; }
[lkundrak at belphegor NetworkManager]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150318/ec0e8408/attachment.html>


More information about the llvm-bugs mailing list