Subject: Re: Division by zero doesn't raise SIGFPE
To: Min Sik Kim <firstname.lastname@example.org>
From: Greywolf <email@example.com>
Date: 12/15/2003 15:45:07
Thus spake Greywolf ("G> ") sometime Today...
G> The above code for me actually returns (exits) 0 unless I compile with
G> -O0, gcc 3.3.2.
G> I think this needs to be filed as a bug against gcc.
I forgot that even -O1 will optimize over a routine which doesn't
do anything useful with local variables.
Suggestion: I'm betting that
int a = 1, b = 0, c;
c = a / b;
will FPE on you.
I retract that this is a bug in gcc, although I think optimizing over
something like the previous example is a faux-pas.
NetBSD: priapic OS