[LLVMbugs] [Bug 21668] New: -Wpointer-bool-conversion doesn't work when the attribute is on the parameter decl

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 25 11:03:10 PST 2014


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

            Bug ID: 21668
           Summary: -Wpointer-bool-conversion doesn't work when the
                    attribute is on the parameter decl
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: rtrieu at google.com
          Reporter: rnk at google.com
                CC: llvmbugs at cs.uiuc.edu, richard-llvm at metafoo.co.uk
    Classification: Unclassified

Consider:
__attribute__((nonnull(1))) int f(const char *p) {
  if (p) // warns
    return 1;
  return 0;
}

int g(__attribute__((nonnull)) const char *p) {
  if (p) // does not warn!
    return 1;
  return 0;
}

The test in test/CodeGen/nonnull.c suggests that this should work, but
apparently it does not?

-- 
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/20141125/4370156a/attachment.html>


More information about the llvm-bugs mailing list