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

           Summary: false positive - divide by zero
           Product: clang
           Version: unspecified
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


This is a simplified version of our code - if tot is zero it returns, so the
devide by zero never happens.  Tested using checker-247

static void ui_litem_layout_split(uiLayout *litem)
{
    uiItem *item;
    int tot = 0;
        float test = 0.0f;

    for(item=litem->items.first; item; item=item->next)
        tot++;

    if(tot == 0)
        return;

    test = 1/(tot-1); //complaint of divide by zero
}

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to