[cfe-dev] no warning for srem by zero?

Sanjiv Gupta sanjiv.gupta at microchip.com
Mon Jan 11 10:58:06 CST 2010


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 ?

- Sanjiv




More information about the cfe-dev mailing list