NetBSD Problem Report #56234

From  Fri Jun  4 18:32:52 2021
Return-Path: <>
Received: from ( [])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id 7EAFB1A921F
	for <>; Fri,  4 Jun 2021 18:32:52 +0000 (UTC)
Message-Id: <>
Date: Fri,  4 Jun 2021 18:32:51 +0000 (UTC)
Subject: missing C99 frobs in <math.h>
X-Send-Pr-Version: 3.95

>Number:         56234
>Category:       standards
>Synopsis:       missing C99 frobs in <math.h>
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    standards-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 04 18:35:00 +0000 2021
>Originator:     David A. Holland
>Release:        NetBSD 9.99.83 (20210604)
System: n/a
Architecture: n/a
Machine: n/a

Crosschecking <math.h> against C99 7.12 shows that we are missing the
following items. (These are documented at the top of math.h, but there
should be a PR as well.)

    MATH_ERRNO (macro)
    MATH_ERREXCEPT (macro)
    math_errhandling (macro or constant)

This is supposed to document whether floating-point gaffes set errno
(MATH_ERRNO) or cause exceptions (MATH_ERREXCEPT) or both

I would expect this to be machine-dependent; it probably makes sense
to put
   #define MATH_ERRNO 1
   #define MATH_ERREXCEPT 2
in math.h and a #define for math_errhandling in every machine/math.h,
but to actually do this we need to collect up the proper values for
each machine. It is probably a bad idea to add the macros for the
cases until we also have math_errhandling at least for major machines,
since if any code out there uses this logic at all (unclear) it's
probably guarded by #ifdef MATH_ERRNO.


These are supposed to be defined if fma{,f,l}() (fused multiply-add)
is preferable (or comparable) to separate multiply and add. This is
machine-dependent, and also, it's an instruction-set thing that the
compiler doubtless already knows; do gcc and/or clang provide backend
support we could hook up to?


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.