[LLVMbugs] [Bug 9075] New: ns_consumed should work with void* pointers.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jan 27 14:07:56 PST 2011


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

           Summary: ns_consumed should work with void* pointers.
           Product: clang
           Version: unspecified
          Platform: Macintosh
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: bugzilla.llvm.j at ayton.se
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=6064)
 --> (http://llvm.org/bugs/attachment.cgi?id=6064)
Test case

Many C libraries allow clients to store void * pointers with arbitrary data or
pass them through to callbacks. It would be helpful if
__attribute__((ns_consumed)) worked in such cases. However, it has no effect on
void * pointers in checker-254.

I posted an example of such a case here:
http://stackoverflow.com/questions/4822178/telling-clang-static-analyzer-about-third-party-libraries-owning-references/
. Ted Kremeneck assumed that ns_consumed would work in this case, but in fact
it does not; however, it works in the analogous case using id pointers.

The attached test case includes a model of the pattern, once with a void *
pointer, once with an id pointer. The checker complains about the void * case,
but not the id case.

-- 
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.



More information about the llvm-bugs mailing list