NetBSD Problem Report #57960

From www@netbsd.org  Sat Feb 24 02:42:48 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 854011A923B
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 24 Feb 2024 02:42:48 +0000 (UTC)
Message-Id: <20240224024247.247EB1A923C@mollari.NetBSD.org>
Date: Sat, 24 Feb 2024 02:42:47 +0000 (UTC)
From: campbell+netbsd@mumble.net
Reply-To: campbell+netbsd@mumble.net
To: gnats-bugs@NetBSD.org
Subject: math.h symbols are inconsistently declared, defined, and tested
X-Send-Pr-Version: www-1.0

>Number:         57960
>Category:       lib
>Synopsis:       math.h symbols are inconsistently declared, defined, and tested
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 24 02:45:00 +0000 2024
>Originator:     Taylor R Campbell
>Release:        current, 10, 9, 8, ...
>Organization:
The NetLibm Foundation
>Environment:
>Description:
Some examples:

- math.h declaration of copysign is restricted to when _NETBSD_SOURCE is defined, despite being in C99
- math.h declaration of copysign is restricted to when _XOPEN_SOURCE or _NETBSD_SOURCE is defined, despite being in C99
- various architectures dropped symbols like atanl recently and nobody noticed
- various architectures are or were for a long time missing various libm symbols, like https://gnats.netbsd.org/53234 and https://gnats.netbsd.org/57881

We have a scattering of libm tests of functionality, and it takes some effort to write correct numerical tests, but we should have automatic tests to ensure systematically that:

- every function/variable/macro is declared under the correct sets of feature macros
- every symbol is defined by libm

It is relatively inexpensive to fix the implementations of symbols in libm on release branches, but forbidden to add missing symbols, so this is very painful every time we notice.
>How-To-Repeat:
do stuff with libm on certain architectures
>Fix:
Yes, please!

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.