Divide by zero?

Stefan Bellon sbellon at sbellon.de
Sun Jan 2 09:01:39 PST 2005


I have just noticed that when compiling with Norcroft and then linking
against UnixLib there does not happen a "Divide by zero". E.g.:

#include <stdio.h>
int main(void)
{
    int a = 5;
    a /= 0;
    printf("a = %i\n", a);
}

This returns ...

a = 0

... when compiled and linked against UnixLib but raises "Divide by
zero" when compiled and linked against the SharedCLibrary.

Am I missing something obvious?

-- 
Stefan Bellon



More information about the gcc mailing list