Subject: Re: Division by zero doesn't raise SIGFPE
To: Min Sik Kim <>
From: Greywolf <>
List: current-users
Date: 12/15/2003 15:34:08
Thus spake Min Sik Kim ("MSK> ") sometime Today...

MSK> Hi,
MSK> I expect the following code (used by many GNU configure scripts) raise
MSK> SIGFPE, but it only hangs consuming 100% CPU time.  This wasn't
MSK> happening on 1.6.1, but seen after I moved to -current.
MSK> Any ideas?
MSK> Min
MSK> ================================
MSK> int main() {
MSK>   int a;
MSK>   int b;
MSK>   int c;
MSK>   a = 1;
MSK>   b = 0;
MSK>   c = a / b;
MSK>   return 0;
MSK> }
MSK> ================================

Which version of gcc are you using?

The above code for me actually returns (exits) 0 unless I compile with
-O0, gcc 3.3.2.

I think this needs to be filed as a bug against gcc.

"Never mind the bollocks, here's NetBSD!"