Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Dec 1999 14:53:19 -0800 (PST)
From:      housel@acm.org
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   i386/15488: Incorrect FPE_*_TRAP macros in machine/trap.h
Message-ID:  <199912142253.OAA85416@cx281057-a.irvn1.occa.home.com>

next in thread | raw e-mail | index | archive | help

>Number:         15488
>Category:       i386
>Synopsis:       Incorrect FPE_*_TRAP macros in machine/trap.h
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 14 15:00:00 PST 1999
>Closed-Date:
>Last-Modified:
>Originator:     Peter S. Housel
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
None
>Environment:

 *	from: @(#)trap.h	5.4 (Berkeley) 5/9/91
 * $FreeBSD: src/sys/i386/include/trap.h,v 1.10 1999/08/28 00:44:27 peter Exp $

>Description:

The following sets of trap codes do not appear to be consistent.
Using the FPE_*_TRAP constants in a trap handler gives incorrect
results.

#define FPE_INTDIV	1	/* integer divide by zero */
#define FPE_INTOVF	2	/* integer overflow */
#define FPE_FLTDIV	3	/* floating point divide by zero */
#define FPE_FLTOVF	4	/* floating point overflow */
#define FPE_FLTUND	5	/* floating point underflow */
#define FPE_FLTRES	6	/* floating point inexact result */
#define FPE_FLTINV	7	/* invalid floating point operation */
#define FPE_FLTSUB	8	/* subscript out of range */

#define	FPE_INTOVF_TRAP	0x1	/* integer overflow */
#define	FPE_INTDIV_TRAP	0x2	/* integer divide by zero */
#define	FPE_FLTDIV_TRAP	0x3	/* floating/decimal divide by zero */
#define	FPE_FLTOVF_TRAP	0x4	/* floating overflow */
#define	FPE_FLTUND_TRAP	0x5	/* floating underflow */
#define	FPE_FPU_NP_TRAP	0x6	/* floating point unit not present  */
#define	FPE_SUBRNG_TRAP	0x7	/* subrange out of bounds */


>How-To-Repeat:

Write a trap handler for integer overflow or integer divide by zero.

>Fix:

Base "depreciated" macros on the updated ones?

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912142253.OAA85416>