[LLVMbugs] [Bug 8006] New: Spurious puzzling warning with --analyze

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 27 01:06:17 PDT 2010


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

           Summary: Spurious puzzling warning with --analyze
           Product: new-bugs
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: listrp at gmail.com
                CC: llvmbugs at cs.uiuc.edu


$ cat test.c

void bar( int x ) { }

void foo( int n )
{
    int x[4096], i;

    for ( i = 0;  i < (1 << n); i++ )
    {
        x[i] = i;
    }

    for ( i = 0;  i < (1 << n); i++ )
    {
        bar( x[i] );
    }
}

$ clang test.c --analyze
test.c:15:3: warning: Pass-by-value argument in function call is undefined
              bar( x[i] );
              ^    ~~~~

According to Ted Kremenek, the problem is that '1 << n' is not getting
accurately modeled, resulting in a false path that triggers the warning.

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