Date: Sun, 17 Mar 2002 00:44:43 +1100 (EST) From: Bruce Evans <bde@zeta.org.au> To: Tadayuki OKADA <tadayuki.okada@windriver.com> Cc: Tadayuki OKADA <tokada@isi.com>, <standards@freebsd.org> Subject: Re: _MULTI_LIBM Message-ID: <20020317001529.T30317-100000@gamplex.bde.org> In-Reply-To: <3C922061.DD01E0B@windriver.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 15 Mar 2002, Tadayuki OKADA wrote: > Bruce Evans wrote: > > > It's not POSIX complient nor ANSI. > > > > It is now :-). C99 supports IEEE754, and doesn't require math functions > > to set errno. > In this respect, yes. But other portion of FreeBSD is not (yet), > so we can't say FreeBSD is C90 complient or C99. > > BTW, why don't we just define math_errhandling, MATH_ERRNO and > MATH_ERREXCEPT in math.h for POSIX complience for now? > Or are we waiting for fenv.h? I didn't know about math_errhandling, MATH_ERRNO or MATH_ERREXCEPT. They seem to be new in POSIX.1-2001 (they aren't in POSIX-1.1996 or C99). math_errhandling seems to be settable by the implemenation only. They are bugs in POSIX IMO. C99 got rid of the broken-as-designed requirement to set errno, but POSIX increased it (in practice). From POSIX-1.200x-draft7: 3861 APPLICATION USAGE 3862 On error, the expressions (math_errhandling & MATH_ERRNO) and (math_errhandling & 3863 MATH_ERREXCEPT) are independent of each other, but at least one of them must be non-zero. I'm not sure if the application can set math_handling. So, POSIX now gives the alternatives of MATH_ERRNO being set (this means that math functions must set errno for all types if "errors" (not just for range errors as required by C90)), or MATH_ERREXCEPT being set (this means that math functions must cause exceptions as not permitted by C9*, but as FreeBSD on i386's used to do). I'm certainly waiting for fenv.h :-). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020317001529.T30317-100000>