From owner-freebsd-hackers Wed Jan 5 8:42:21 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from monkeys.com (i180.value.net [206.14.136.180]) by hub.freebsd.org (Postfix) with ESMTP id 0718E14CB7 for ; Wed, 5 Jan 2000 08:42:18 -0800 (PST) (envelope-from rfg@monkeys.com) Received: from monkeys.com (localhost [127.0.0.1]) by monkeys.com (8.9.3/8.9.3) with ESMTP id IAA91756; Wed, 5 Jan 2000 08:42:06 -0800 (PST) To: Martin Cracauer Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Should -mieee-fp equal fpsetmask(0) to avoid SIGFPE on FreeBSD? In-reply-to: Your message of Wed, 05 Jan 2000 09:50:02 +0100. <20000105095002.B8100@cons.org> Date: Wed, 05 Jan 2000 08:42:06 -0800 Message-ID: <91754.947090526@monkeys.com> From: "Ronald F. Guilmette" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <20000105095002.B8100@cons.org>, Martin Cracauer wrote: >In <87632.947017515@monkeys.com>, Ronald F. Guilmette wrote: >> ... >> I agree that it appears that the Mozilla code had a serious bug/flaw, >> and that having the FP traps enabled caused that fact to become >> apparent. >> >> But the issue for me is still one of standards conformance. Regardless of >> how helpful enabled FP traps may be, on occasion, for certain programs >> and/or certain programmers, the IEEE 754 standard is pretty darn clear >> and unambiguous regarding what the default setting should be, i.e. all >> traps disabled. > >You mix up two things: > >1) "Real" floating point arithmetic between floating types. > >2) Conversion of floating point types to integer. > >The authority on the latter issue is ANSI C, not ieee754. > >ANSI C 89 states in 6.2.1.3 explicitly, that "if the value of the >integral part cannot be represented by the integral type, the >behaviour is undefined". >ANSI C 99 (WG14/N869 Committee Draft -- January 18, 1999) has the same >sentense in 6.3.1.4. > >Note that "undefined behaviour" in ANSI C means that anything can >happen. I agress with your assertions regarding the C standard completely, but... I don't think that I mixed anything up. There is a bug in the Mozilla code (for the reasons you mentioned) _and_ also a bug in FreeBSD's conformance to IEEE 754 (or lack thereof). Didn't I say that? -- rfg To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message