Hi folks,

I'm looking for an explanation of a difference I've found between NetBSD
and FreeBSD in the handling of arithmetic overflow in typecasting.

The following code, compiled on a stock FreeBSD 4.0-CURRENT machine
cores on SIGFPE.  On a NetBSD 1.4.1 machine (gcc-2.91.60), the program
prints the value of INT_MAX.

        int
        main(void)
        {
                double  x;
                int     i;

                x = 1e19;
                i = (int)x;
                printf("%d\n", i);

                return 0;
        }

So can anyone explain the cause of this difference to me? :-)

Ciao,
Sheldon.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to