http://llvm.org/bugs/show_bug.cgi?id=5297

           Summary: Wwarn about operator precedence with &/==
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: new-feature
          Severity: minor
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


blackthorn:clang dgregor$ cat t.c
int f(unsigned x) {
  if (x & 0x01 == 0)
    return 0;

  return 1;
}

blackthorn:clang dgregor$ gcc -Wall -fsyntax-only t.c
t.c: In function ‘f’:
t.c:2: warning: suggest parentheses around comparison in operand of &
blackthorn:clang dgregor$ clang -Wall -fsyntax-only t.c

See
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20091019/022705.html
for some motivation.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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