[LLVMbugs] [Bug 7152] New: Static Analyzer false positive

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun May 16 15:34:27 PDT 2010


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

           Summary: Static Analyzer false positive
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: swildner at erpicon.de
                CC: llvmbugs at cs.uiuc.edu


The following short program, when run through scan-build, generates a warning
("warning: Undefined or garbage value returned to caller"):

----------8<----------
#define FLAG 0x200
int moo = FLAG;

int
main(void)
{
        int uninit;

        if (moo & FLAG)
                uninit = 1;
        if ((moo & FLAG) == 0)
                return 0;
        return uninit;
}
---------->8----------

However, it shouldn't, since a valid value is returned in any case.

Regards,
Sascha Wildner

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