NetBSD Problem Report #43138

From www@NetBSD.org  Thu Apr  8 06:59:32 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 27C8663C4B5
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  8 Apr 2010 06:59:32 +0000 (UTC)
Message-Id: <20100408065931.D582E63BA59@www.NetBSD.org>
Date: Thu,  8 Apr 2010 06:59:31 +0000 (UTC)
From: dennis.c.ferguson@gmail.com
Reply-To: dennis.c.ferguson@gmail.com
To: gnats-bugs@NetBSD.org
Subject: C99/POSIX long double functions missing from math library/<math.h>
X-Send-Pr-Version: www-1.0

>Number:         43138
>Category:       standards
>Synopsis:       C99/POSIX long double functions missing from math library/<math.h>
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    standards-manager
>State:          closed
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 08 07:00:08 +0000 2010
>Closed-Date:    Fri Dec 28 13:30:37 +0000 2018
>Last-Modified:  Fri Dec 28 13:30:37 +0000 2018
>Originator:     Dennis Ferguson
>Release:        fairly recent 5.99.24
>Organization:
>Environment:
NetBSD timerxxx.akit-ferguson.com 5.99.24 NetBSD 5.99.24 (GENERIC) #0: Mon Mar 22 15:11:34 HKT 2010  dennis@dennisbigmac.akit-ferguson.com:/Users/dennis/NetBSD/5.0-current/src/sys/arch/amd64/compile/obj/GENERIC amd64

>Description:
Compiling the following C99 program

#include <math.h>

long double
my_fabsl(long double x)
{
    return (fabsl(x));
}

using something of the form

cc -c my_fabsl.c

produces the following warning:

t_fabsl.c: In function 'my_fabsl':
t_fabsl.c:6: warning: incompatible implicit declaration of built-in function 'fabsl'

fabsl() is supposed to be declared in <math.h>, but isn't.
Neither are most of the other math library long double functions.

It isn't that I care much about about long double functions,
it is just that it bothers me that one can write code which
strictly conforms to textbook C99, and uses nothing beyond
that, which fails to compile or link cleanly on NetBSD.  Since
the C standard just requires the functions to be there, there
is no hint of a reason in there to avoid these functions in code,
let alone a standard way to detect their absence at compile time
and conditionally avoid their use, so I guess the code I'm having
trouble with may get some #ifdef __NetBSD__'s.
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Fri, 28 Dec 2018 13:30:37 +0000
State-Changed-Why:
This works now. Thanks for the report!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.