[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

**To**:**Ignatios Souvatzis <is%NetBSD.org@localhost>****Subject**:**Re: standards on SIGFPE for divide by zero****From**:**Steven Bellovin <smb%cs.columbia.edu@localhost>**- Date: Thu, 3 Mar 2011 07:32:03 -0500

On Mar 3, 2011, at 2:12 18AM, Ignatios Souvatzis wrote: > On Wed, Mar 02, 2011 at 02:59:32PM -0500, Thor Lancelot Simon wrote: > >> You want the program to get a floating-point-exception signal on a bad >> integer divide? > > Uh, it's been a generic arithmetic error signal for a long time, like > ENOTTY complaining about generic wrong-type-of-file-descriptor situations. > I was surprised by that a couple of years ago. > > SUSV3 defines: > > SIGFPE A Erroneous arithmetic operation. > ... > SIGFPE FPE_INTDIV Integer divide by zero. > FPE_INTOVF Integer overflow. > FPE_FLTDIV Floating-point divide by zero. > (...) > > Now, if the hardware in question can't create SIGFPE on integer divide, > I don't think we should torture the compiler into simulating it. > What does the C standard say? Is the exception required? --Steve Bellovin, http://www.cs.columbia.edu/~smb

**Follow-Ups**:**Re: standards on SIGFPE for divide by zero***From:*Ignatios Souvatzis

**References**:**Re: standards on SIGFPE for divide by zero***From:*Matt Thomas

**Re: standards on SIGFPE for divide by zero***From:*Taylor R Campbell

**Re: standards on SIGFPE for divide by zero***From:*Thor Lancelot Simon

**Re: standards on SIGFPE for divide by zero***From:*Ignatios Souvatzis

- Prev by Date:
**Re: standards on SIGFPE for divide by zero** - Next by Date:
**Re: standards on SIGFPE for divide by zero** - Previous by Thread:
**Re: standards on SIGFPE for divide by zero** - Next by Thread:
**Re: standards on SIGFPE for divide by zero** - Indexes: