[LLVMbugs] [Bug 7482] New: False positive in idiom used in (for example) git source

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 24 07:51:57 PDT 2010


           Summary: False positive in idiom used in (for example) git
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: bruce.r.stephens at gmail.com
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=5103)
 --> (http://llvm.org/bugs/attachment.cgi?id=5103)
Simple example of the kind of thing used a lot in git

I think this is used to avoid warnings from less sophisticated analysis.  It
seems to be used quite a bit in the git source, anyway.  In the attached file
the warning ought to be on the condition, since there the code clearly is using
garbage/undefined values.

However, clang warns on the declaration/initialisation, and I think it should
not.  In this specific case I think the initialisation should just be ignored.

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