From owner-freebsd-standards Sat Mar 16 14:35:29 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mail.wrs.com (unknown-1-11.windriver.com [147.11.1.11]) by hub.freebsd.org (Postfix) with ESMTP id E78D537B402 for ; Sat, 16 Mar 2002 14:35:25 -0800 (PST) Received: from windriver.com (IDENT:root@pburas.epilogue.com [128.224.4.10]) by mail.wrs.com (8.9.3/8.9.1) with ESMTP id OAA18165; Sat, 16 Mar 2002 14:34:55 -0800 (PST) Message-ID: <3C93C9C5.F085857A@windriver.com> Date: Sat, 16 Mar 2002 17:40:05 -0500 From: Tadayuki OKADA X-Mailer: Mozilla 4.79C-ja [ja_JP.EUC] (X11; U; Linux 2.4.2 i386) X-Accept-Language: ja, en MIME-Version: 1.0 To: Bruce Evans Cc: Tadayuki OKADA , standards@freebsd.org Subject: Re: _MULTI_LIBM References: <20020317001529.T30317-100000@gamplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Bruce Evans wrote: > > 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. from POSIX.1-2001 Base Definitions Chapter13 Headers : The following macros shall expand to the integer constants 1 and 2, respectively; MATH_ERRNO MATH_ERREXCEPT The following macro shall expand to an expression that has type int and the value MATH_ERRNO, MATH_ERREXCEPT, or the bitwise-inclusive OR of both: math_errhandling The value of math_errhandling is constant for the duration of the program. It is unspecified whether math_errhandling is a macro or an identifier with external linkage. If a macro definition is suppressed or a program defines an identifier with the name math_errhandling , the behavior is undefined. If the expression (math_errhandling & MATH_ERREXCEPT) can be non-zero, the implementation shall define the macros FE_DIVBYZERO, FE_INVALID, and FE_OVERFLOW in . > They are bugs in POSIX IMO. C99 got rid of the broken-as-designed > requirement to set errno, but POSIX increased it (in practice). No, new POSIX just requires one of 'errno' or 'exception' error handling must be present. You don't need to set 'errno', but then you have to have exception handling defined in . I don't know if C99 mandates one of them to be present. > I'm not sure if the application can set math_handling. I think it can't. See quotation above. > 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). MATH_ERREXCEPT means you can use fp-exception facility defined in , so it's not inconsistent with C99. Regards, -- Tadayuki OKADA To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message