NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

standards/43138: C99/POSIX long double functions missing from math library/<math.h>



>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:          open
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 08 07:00:08 +0000 2010
>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@localhost:/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:



Home | Main Index | Thread Index | Old Index