[LLVMbugs] [Bug 20536] New: Only ignore warnings on macro bodies, not macro arguments

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 4 14:49:47 PDT 2014


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

            Bug ID: 20536
           Summary: Only ignore warnings on macro bodies, not macro
                    arguments
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: rtrieu at google.com
          Reporter: rtrieu at google.com
                CC: dblaikie at gmail.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

#define assert(x) if(x) return;

bool foo();

void test(bool x, bool y, bool z, unsigned a) {
  assert(x || y && z);     // needs -Wparentheses warning here
  if (x || y && z) {}      // warns here

  assert(a >= 0);  // needs -Wtautological-compare here
  if (a >= 0) {}   // warns here
} 

The two asserts above should generate warnings since the entire expression that
should be warned on is inside the macro argument.

r214672 & r214671 fixed two issues that were not caught by the current Clang
warnings.

-- 
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/20140804/e5146651/attachment.html>


More information about the llvm-bugs mailing list