[LLVMbugs] [Bug 9645] New: Uninitialized value false positive when pointer captured by ctor/method

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 7 12:20:21 PDT 2011


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

           Summary: Uninitialized value false positive when pointer
                    captured by ctor/method
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: nherring at google.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=6408)
 --> (http://llvm.org/bugs/attachment.cgi?id=6408)
small reproduction case

A C++ object method taking a pointer argument has the opportunity to capture
said pointer in its own or associated state s.t., later a side effect of
another method call would be to initialize the value pointed to by the method.
This is really no different than a C function taking an argument and storing it
in global state, and having another C function mutate it.

In the attached reproduction, the value of main's local int i is initialized by
the time that UseMe is called, but clang warns anyway:

test.cc:19:3: warning: Function call argument is an uninitialized value
  exit(i);
  ^    ~
1 warning generated.

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