[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


           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"):

#define FLAG 0x200
int moo = FLAG;

        int uninit;

        if (moo & FLAG)
                uninit = 1;
        if ((moo & FLAG) == 0)
                return 0;
        return uninit;

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

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