[llvm-bugs] [Bug 25766] New: Macro inhibits -Wtautological-compare warning

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 7 09:59:47 PST 2015


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

            Bug ID: 25766
           Summary: Macro inhibits -Wtautological-compare warning
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: steveire at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

With this code:

#define MY_ASSERT(_expr_) \
  { (void)((_expr_)); }

int main()
{
    unsigned int foo = 0;
    MY_ASSERT(foo >= 0);
    { (void)((foo >= 0)); }
}

the line with the macro does not emit a warning.

The expanded version of the macro content does issue a warning.

-- 
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/20151207/04ba9ec2/attachment.html>


More information about the llvm-bugs mailing list