[LLVMbugs] [Bug 10163] New: false positive on partially initialized array of floating point values.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jun 21 00:48:55 PDT 2011


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

           Summary: false positive on partially initialized array of
                    floating point values.
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: devlists at shadowlab.org
                CC: llvmbugs at cs.uiuc.edu


When using implicit array initialization on array of non integral values
(either float or double), clang properly generate a memset(0) to initialize the
array, but the static analyzer does not consider the array as initialized.

----- foo.c
extern void CGAffineTransformMake(double a, double b, double c, double d,
double tx, double ty);

void test2() {
  float matrix[6] = { 0 };
  return CGAffineTransformMake(matrix[0], matrix[1], matrix[2], matrix[3],
matrix[4], matrix[5]);
}
------

$ clang --analyze foo.c
foo.c:7:10: warning: Function call argument is an uninitialized value
  return CGAffineTransformMake(matrix[0], matrix[1], matrix[2], matrix[3],
matrix[4], matrix[5]);
         ^                                ~~~~~~~~~
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