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

Eli Friedman eli.friedman at gmail.com
Mon Jan 11 00:26:22 CST 2010


On Mon, Jan 11, 2010 at 8:58 AM, Sanjiv Gupta
<sanjiv.gupta at microchip.com> wrote:
> 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 ?

No particularly good reason; feel free to file a bug.

-Eli



More information about the cfe-dev mailing list