From owner-freebsd-standards@FreeBSD.ORG Fri Mar 12 04:22:05 2004 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C960016A4CE; Fri, 12 Mar 2004 04:22:05 -0800 (PST) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0BDF743D2D; Fri, 12 Mar 2004 04:22:03 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87])i2CCLinX009302; Fri, 12 Mar 2004 23:21:44 +1100 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i2CCLfGi015695; Fri, 12 Mar 2004 23:21:43 +1100 Date: Fri, 12 Mar 2004 23:21:41 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Stefan Farfeleder In-Reply-To: <20030916130805.GD697@wombat.fafoe.narf.at> Message-ID: <20040312230554.V10266@gamplex.bde.org> References: <20030915225329.95B30498@frog.fafoe.narf.at> <20030916130805.GD697@wombat.fafoe.narf.at> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-standards@freebsd.org cc: bug-followup@freebsd.org Subject: Re: standards/56906: Several math(3) functions fail to set errno on a domain error X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Mar 2004 12:22:05 -0000 Long ago, on Tue, 16 Sep 2003, Stefan Farfeleder wrote: > On Tue, Sep 16, 2003 at 11:42:44AM +1000, Bruce Evans wrote: > > On Tue, 16 Sep 2003, Stefan Farfeleder wrote: > > > >Description: > > > ISO C90 says that errno must be set to EDOM if a domain error occurs. > > > > As you probably know, C99 doesn't require this. ... > > Hm, having a conforming C90 environment would be nice despite C99's > existence as older compliant applications may depend on the former > behaviour and don't become magically C99 conformant. Is there a chance > to have a separated C90 compliant libm? Looks like not a large chance :-). Old applications have somehow dealt with FreeBSD's libm not having C90-conformant error handling for 10+ years, so fixing this doesn't seem urgent. > Anyway, here's a patch to give C99 application at least the possibility > to notice that errno doesn't get set for these functions. Because we > don't have to access the floating point status flags, I'm > setting math_errhandling to 0. Committed with minor reordering. I wasn't sure about the C99 visibility ifdef because my (draft) copy of C99 doesn't have MATH_ERRO, but POSIX.1-2001 doesn't say that it is an extension and glibc uses the same ifdef, so I assumed that the ifdef is correct. David Schulz has almost ready, but we are still missing both a compiler that actually understands and sources that set the exception flags in a way that doesn't get optimized (FENV_ACCESS should make the current code work, but is not supported by the compiler, and changing all the flags-setting hacks like huge*huge to explicitly set exception flags would require large changes). Bruce