[LLVMbugs] [Bug 6004] New: clang does not generate a warning for division by zero.

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Jan 11 18:57:20 PST 2010


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

           Summary: clang does not generate a warning for division by zero.
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: sanjiv.gupta at microchip.com
                CC: llvmbugs at cs.uiuc.edu


gcc generates a warning 

C16-115-1.c:7: warning: division by zero

for the following code:


char *pc = (char *) 0xA0;

volatile signed char char1 = 0xFF;

int main(void)
{
  if ( char1 % 0) {
    *pc = 1;
  }
  else
    *pc = 0;
}



Why clang doesn't ?


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