glibc/math/bits/math-finite.h

507 lines
15 KiB
C
Raw Normal View History

/* Entry points to finite-math-only compiler runs.
Copyright (C) 2011-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#ifndef _MATH_H
# error "Never use <bits/math-finite.h> directly; include <math.h> instead."
#endif
/* acos. */
extern double __REDIRECT_NTH (acos, (double), __acos_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#ifdef __USE_ISOC99
extern float __REDIRECT_NTH (acosf, (float), __acosf_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (acosl, (long double), __acos_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# else
extern long double __REDIRECT_NTH (acosl, (long double), __acosl_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# endif
# endif
#endif
Complete _BSD_SOURCE / _SVID_source followup cleanup. This patch completes the headers cleanup consequent on removal of _BSD_SOURCE and _SVID_SOURCE (apart from any subsequent deprecations): * #endif conditionals that referred to BSD or SVID are updated. * Redundant __USE_* tests in cases involving __USE_MISC are removed. This includes cases such as __USE_MISC || __USE_ISOC99, where __USE_MISC is redundant (because __USE_MISC is only ever defined in the default / _DEFAULT_SOURCE / _GNU_SOURCE case, when __USE_ISOC99 is also defined; the same applies to the non-XSI-extended POSIX versions), and cases involving __USE_GNU, where __USE_GNU is redundant (because if __USE_GNU is defined, so are the other __USE_* macros). There may well be other cases of __USE_FOO || __USE_BAR tests that could be simplified because one macro implies the other; this patch only addresses cases involving __USE_MISC. Tested x86_64. * bits/fcntl.h [__USE_MISC]: Remove redundant conditionals. * bits/sigaction.h [__USE_MISC]: Likewise. * bits/waitstatus.h: Update #endif comments. * ctype/ctype.h: Likewise. * dirent/dirent.h: Likewise. [__USE_MISC]: Remove redundant conditionals. * grp/grp.h: Update #endif comments. [__USE_GNU]: Remove redundant conditionals. [__USE_MISC]: Likewise. * inet/netinet/in.h [__USE_GNU]: Likewise. * io/sys/stat.h [__USE_MISC]: Likewise. * libio/bits/stdio-ldbl.h [__USE_MISC]: Likewise. * libio/bits/stdio.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * libio/bits/stdio2.h [__USE_MISC]: Likewise. * libio/stdio.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * math/bits/math-finite.h [__USE_MISC]: Likewise. * math/bits/mathcalls.h [__USE_MISC]: Likewise. * math/math.h: Update #else and #endif comments. [__USE_MISC]: Remove redundant conditionals. * misc/sys/uio.h: Update #endif comments. * posix/bits/unistd.h [__USE_MISC]: Remove redundant conditionals. * posix/glob.h [__USE_MISC]: Likewise. * posix/sys/types.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * posix/sys/wait.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * posix/unistd.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * pwd/pwd.h [__USE_GNU]: Likewise. [__USE_MISC]: Likewise. * resolv/netdb.h [__USE_GNU]: Likewise. * signal/signal.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * stdlib/stdlib.h: Update #else and #endif comments. [__USE_MISC]: Remove redundant conditionals. [__USE_GNU]: Likewise. * string/bits/string2.h [__USE_MISC]: Likewise. * string/string.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * sysdeps/m68k/m680x0/fpu/bits/mathinline.h [__USE_MISC]: Likewise. * sysdeps/mach/hurd/bits/fcntl.h [__USE_MISC]: Likewise. * sysdeps/mach/hurd/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/bits/fcntl-linux.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * sysdeps/unix/sysv/linux/bits/in.h [__USE_GNU]: Likewise. * sysdeps/unix/sysv/linux/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/bits/socket.h [__USE_GNU]: Likewise. * sysdeps/unix/sysv/linux/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/ia64/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/m68k/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/mips/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/mips/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/s390/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/s390/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/x86/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/x86/bits/string.h: Update #endif comments. * sysdeps/x86/fpu/bits/mathinline.h [__USE_MISC]: Remove redundant conditionals. * time/sys/time.h: Update #endif comments. * time/time.h: Likewise. [__USE_MISC]: Remove redundant conditionals.
2014-02-21 22:45:26 +01:00
#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
/* acosh. */
extern double __REDIRECT_NTH (acosh, (double), __acosh_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
#ifdef __USE_ISOC99
extern float __REDIRECT_NTH (acoshf, (float), __acoshf_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (acoshl, (long double), __acosh_finite);
# else
extern long double __REDIRECT_NTH (acoshl, (long double), __acoshl_finite);
# endif
# endif
#endif
/* asin. */
extern double __REDIRECT_NTH (asin, (double), __asin_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#ifdef __USE_ISOC99
extern float __REDIRECT_NTH (asinf, (float), __asinf_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (asinl, (long double), __asin_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# else
extern long double __REDIRECT_NTH (asinl, (long double), __asinl_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# endif
# endif
#endif
/* atan2. */
extern double __REDIRECT_NTH (atan2, (double, double), __atan2_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#ifdef __USE_ISOC99
extern float __REDIRECT_NTH (atan2f, (float, float), __atan2f_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (atan2l, (long double, long double),
__atan2_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# else
extern long double __REDIRECT_NTH (atan2l, (long double, long double),
__atan2l_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# endif
# endif
#endif
Complete _BSD_SOURCE / _SVID_source followup cleanup. This patch completes the headers cleanup consequent on removal of _BSD_SOURCE and _SVID_SOURCE (apart from any subsequent deprecations): * #endif conditionals that referred to BSD or SVID are updated. * Redundant __USE_* tests in cases involving __USE_MISC are removed. This includes cases such as __USE_MISC || __USE_ISOC99, where __USE_MISC is redundant (because __USE_MISC is only ever defined in the default / _DEFAULT_SOURCE / _GNU_SOURCE case, when __USE_ISOC99 is also defined; the same applies to the non-XSI-extended POSIX versions), and cases involving __USE_GNU, where __USE_GNU is redundant (because if __USE_GNU is defined, so are the other __USE_* macros). There may well be other cases of __USE_FOO || __USE_BAR tests that could be simplified because one macro implies the other; this patch only addresses cases involving __USE_MISC. Tested x86_64. * bits/fcntl.h [__USE_MISC]: Remove redundant conditionals. * bits/sigaction.h [__USE_MISC]: Likewise. * bits/waitstatus.h: Update #endif comments. * ctype/ctype.h: Likewise. * dirent/dirent.h: Likewise. [__USE_MISC]: Remove redundant conditionals. * grp/grp.h: Update #endif comments. [__USE_GNU]: Remove redundant conditionals. [__USE_MISC]: Likewise. * inet/netinet/in.h [__USE_GNU]: Likewise. * io/sys/stat.h [__USE_MISC]: Likewise. * libio/bits/stdio-ldbl.h [__USE_MISC]: Likewise. * libio/bits/stdio.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * libio/bits/stdio2.h [__USE_MISC]: Likewise. * libio/stdio.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * math/bits/math-finite.h [__USE_MISC]: Likewise. * math/bits/mathcalls.h [__USE_MISC]: Likewise. * math/math.h: Update #else and #endif comments. [__USE_MISC]: Remove redundant conditionals. * misc/sys/uio.h: Update #endif comments. * posix/bits/unistd.h [__USE_MISC]: Remove redundant conditionals. * posix/glob.h [__USE_MISC]: Likewise. * posix/sys/types.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * posix/sys/wait.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * posix/unistd.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * pwd/pwd.h [__USE_GNU]: Likewise. [__USE_MISC]: Likewise. * resolv/netdb.h [__USE_GNU]: Likewise. * signal/signal.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * stdlib/stdlib.h: Update #else and #endif comments. [__USE_MISC]: Remove redundant conditionals. [__USE_GNU]: Likewise. * string/bits/string2.h [__USE_MISC]: Likewise. * string/string.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * sysdeps/m68k/m680x0/fpu/bits/mathinline.h [__USE_MISC]: Likewise. * sysdeps/mach/hurd/bits/fcntl.h [__USE_MISC]: Likewise. * sysdeps/mach/hurd/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/alpha/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/bits/fcntl-linux.h: Update #endif comments. [__USE_MISC]: Remove redundant conditionals. * sysdeps/unix/sysv/linux/bits/in.h [__USE_GNU]: Likewise. * sysdeps/unix/sysv/linux/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/bits/socket.h [__USE_GNU]: Likewise. * sysdeps/unix/sysv/linux/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/ia64/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/m68k/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/mips/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/mips/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/s390/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/s390/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/sigaction.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/unix/sysv/linux/x86/bits/stat.h [__USE_MISC]: Likewise. * sysdeps/x86/bits/string.h: Update #endif comments. * sysdeps/x86/fpu/bits/mathinline.h [__USE_MISC]: Remove redundant conditionals. * time/sys/time.h: Update #endif comments. * time/time.h: Likewise. [__USE_MISC]: Remove redundant conditionals.
2014-02-21 22:45:26 +01:00
#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
/* atanh. */
extern double __REDIRECT_NTH (atanh, (double), __atanh_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
#ifdef __USE_ISOC99
extern float __REDIRECT_NTH (atanhf, (float), __atanhf_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (atanhl, (long double), __atanh_finite);
# else
extern long double __REDIRECT_NTH (atanhl, (long double), __atanhl_finite);
# endif
# endif
#endif
/* cosh. */
extern double __REDIRECT_NTH (cosh, (double), __cosh_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#ifdef __USE_ISOC99
extern float __REDIRECT_NTH (coshf, (float), __coshf_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (coshl, (long double), __cosh_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# else
extern long double __REDIRECT_NTH (coshl, (long double), __coshl_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# endif
# endif
#endif
/* exp. */
extern double __REDIRECT_NTH (exp, (double), __exp_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#ifdef __USE_ISOC99
extern float __REDIRECT_NTH (expf, (float), __expf_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (expl, (long double), __exp_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# else
extern long double __REDIRECT_NTH (expl, (long double), __expl_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# endif
# endif
#endif
#ifdef __USE_GNU
/* exp10. */
extern double __REDIRECT_NTH (exp10, (double), __exp10_finite);
extern float __REDIRECT_NTH (exp10f, (float), __exp10f_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (exp10l, (long double), __exp10_finite);
# else
extern long double __REDIRECT_NTH (exp10l, (long double), __exp10l_finite);
# endif
# endif
/* pow10. */
extern double __REDIRECT_NTH (pow10, (double), __exp10_finite);
extern float __REDIRECT_NTH (pow10f, (float), __exp10f_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (pow10l, (long double), __exp10_finite);
# else
extern long double __REDIRECT_NTH (pow10l, (long double), __exp10l_finite);
# endif
# endif
#endif
#ifdef __USE_ISOC99
/* exp2. */
extern double __REDIRECT_NTH (exp2, (double), __exp2_finite);
extern float __REDIRECT_NTH (exp2f, (float), __exp2f_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (exp2l, (long double), __exp2_finite);
# else
extern long double __REDIRECT_NTH (exp2l, (long double), __exp2l_finite);
# endif
# endif
#endif
/* fmod. */
extern double __REDIRECT_NTH (fmod, (double, double), __fmod_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#ifdef __USE_ISOC99
extern float __REDIRECT_NTH (fmodf, (float, float), __fmodf_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (fmodl, (long double, long double),
__fmod_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# else
extern long double __REDIRECT_NTH (fmodl, (long double, long double),
__fmodl_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# endif
# endif
#endif
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#if defined __USE_XOPEN || defined __USE_ISOC99
/* hypot. */
extern double __REDIRECT_NTH (hypot, (double, double), __hypot_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
#ifdef __USE_ISOC99
extern float __REDIRECT_NTH (hypotf, (float, float), __hypotf_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (hypotl, (long double, long double),
__hypot_finite);
# else
extern long double __REDIRECT_NTH (hypotl, (long double, long double),
__hypotl_finite);
# endif
# endif
#endif
#if defined __USE_MISC || defined __USE_XOPEN
/* j0. */
extern double __REDIRECT_NTH (j0, (double), __j0_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
#if defined __USE_MISC && defined __USE_ISOC99
extern float __REDIRECT_NTH (j0f, (float), __j0f_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (j0l, (long double), __j0_finite);
# else
extern long double __REDIRECT_NTH (j0l, (long double), __j0l_finite);
# endif
# endif
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#if defined __USE_MISC || defined __USE_XOPEN
/* y0. */
extern double __REDIRECT_NTH (y0, (double), __y0_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
#if defined __USE_MISC && defined __USE_ISOC99
extern float __REDIRECT_NTH (y0f, (float), __y0f_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (y0l, (long double), __y0_finite);
# else
extern long double __REDIRECT_NTH (y0l, (long double), __y0l_finite);
# endif
# endif
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#if defined __USE_MISC || defined __USE_XOPEN
/* j1. */
extern double __REDIRECT_NTH (j1, (double), __j1_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
#if defined __USE_MISC && defined __USE_ISOC99
extern float __REDIRECT_NTH (j1f, (float), __j1f_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (j1l, (long double), __j1_finite);
# else
extern long double __REDIRECT_NTH (j1l, (long double), __j1l_finite);
# endif
# endif
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#if defined __USE_MISC || defined __USE_XOPEN
/* y1. */
extern double __REDIRECT_NTH (y1, (double), __y1_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
#if defined __USE_MISC && defined __USE_ISOC99
extern float __REDIRECT_NTH (y1f, (float), __y1f_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (y1l, (long double), __y1_finite);
# else
extern long double __REDIRECT_NTH (y1l, (long double), __y1l_finite);
# endif
# endif
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#if defined __USE_MISC || defined __USE_XOPEN
/* jn. */
extern double __REDIRECT_NTH (jn, (int, double), __jn_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
#if defined __USE_MISC && defined __USE_ISOC99
extern float __REDIRECT_NTH (jnf, (int, float), __jnf_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (jnl, (int, long double), __jn_finite);
# else
extern long double __REDIRECT_NTH (jnl, (int, long double), __jnl_finite);
# endif
# endif
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#if defined __USE_MISC || defined __USE_XOPEN
/* yn. */
extern double __REDIRECT_NTH (yn, (int, double), __yn_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
#if defined __USE_MISC && defined __USE_ISOC99
extern float __REDIRECT_NTH (ynf, (int, float), __ynf_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (ynl, (int, long double), __yn_finite);
# else
extern long double __REDIRECT_NTH (ynl, (int, long double), __ynl_finite);
# endif
# endif
#endif
#ifdef __USE_MISC
/* lgamma_r. */
extern double __REDIRECT_NTH (lgamma_r, (double, int *), __lgamma_r_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# ifdef __USE_ISOC99
extern float __REDIRECT_NTH (lgammaf_r, (float, int *), __lgammaf_r_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (lgammal_r, (long double, int *),
__lgamma_r_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# else
extern long double __REDIRECT_NTH (lgammal_r, (long double, int *),
__lgammal_r_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# endif
# endif
# endif
#endif
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
extern double __lgamma_r_finite (double, int *);
extern float __lgammaf_r_finite (float, int *);
#ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (__lgammal_r_finite, (long double, int *),
__lgamma_r_finite);
#else
extern long double __lgammal_r_finite (long double, int *);
#endif
Revert to defining __extern_inline only for gcc-4.3+ (BZ #17266) The check for only __GNUC_STDC_INLINE__ and __GNUC_GNU_INLINE__ may not be sufficient since those flags were added during initial support for C99 inlining semantics. There is also a problem with always defining __extern_inline and __extern_always_inline, since it enables inline wrapper functions even when GNU inlining semantics are not guaranteed. This, along with the possibility of such wrappers using redirection (btowc for example) could result in compiler generating an infinitely recusrive call to the function. In fact it was such a recursion that led to this code being written the way it was; see: https://bugzilla.redhat.com/show_bug.cgi?id=186410 The initial change was to fix bugs 14530 and 13741, but they can be resolved by checking if __fortify_function and/or __extern_always_inline are defined, as it has been done in this patch. In addition, I have audited uses of __extern_always_inline to make sure that none of the uses result in compilation errors. There is however a regression in this patch for llvm, since it reverts the llvm expectation that __GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE__ definition imply proper extern inline semantics. 2014-09-16 Siddhesh Poyarekar <siddhesh@redhat.com> Jakub Jelinek <jakub@redhat.com> [BZ #17266] * libio/stdio.h: Check definition of __fortify_function instead of __extern_always_inline to include bits/stdio2.h. * math/bits/math-finite.h [__USE_XOPEN || __USE_ISOC99]: Also check if __extern_always_inline is defined. [__USE_MISC || __USE_XOPEN]: Likewise. [__USE_ISOC99] Likewise. * misc/sys/cdefs.h (__fortify_function): Define only if __extern_always_inline is defined. [!__cplusplus || __GNUC_PREREQ (4,3)]: Revert to defining __extern_always_inline and __extern_inline only for g++-4.3 and newer or a compatible gcc.
2014-09-16 10:38:48 +02:00
#if ((defined __USE_XOPEN || defined __USE_ISOC99) \
&& defined __extern_always_inline)
/* lgamma. */
__extern_always_inline double __NTH (lgamma (double __d))
{
Fix finite-math-only lgamma functions signgam setting (bug 19211). The lgamma inline functions in bits/math-finite.h do not set signgam if __USE_ISOC99, even when other feature test macros mean a standard such as XSI POSIX is selected for which it should be set. (This is essentially the opposite issue to bug 15421, the out-of-line versions setting signgam even when they shouldn't.) This patch fixes those functions to use __USE_MISC || __USE_XOPEN as the condition for when to set signgam, since it's the condition for when math.h declares signgam. The legacy gamma* names are only declared at all if __USE_MISC || __USE_XOPEN, so they just set signgam unconditionally. Tests for certain standards or not using _GNU_SOURCE cannot use test-skeleton.c (this is a known issue noted on the wiki todo list). Thus, the new tests that signgam remains not set in ISO C modes do not use test-skeleton.c. They also define _ISOMAC to avoid running into declarations in the internal include/ headers that only work in _GNU_SOURCE mode. Tested for x86_64 and x86. [BZ #19211] * math/bits/math-finite.h (lgamma): Set signgam if [__USE_MISC || __USE_XOPEN], not if [!__USE_ISOC99]. (lgammaf): Likewise. (lgammal): Likewise. (gamma): Set signgam unconditionally, not if [!__USE_ISOC99]. (gammaf): Likewise. (gammal): Likewise. * math/test-signgam-finite-c11.c: New file. * math/test-signgam-finite-c99.c: Likewise. * math/test-signgam-finite.c: Likewise. * math/Makefile (tests): Add test-signgam-finite, test-signgam-finite-c99 and test-signgam-finite-c11. (CFLAGS-test-signgam-finite.c): New variable. (CFLAGS-test-signgam-finite-c99.c): Likewise. (CFLAGS-test-signgam-finite-c11.c): Likewise.
2015-11-05 22:23:07 +01:00
# if defined __USE_MISC || defined __USE_XOPEN
return __lgamma_r_finite (__d, &signgam);
# else
int __local_signgam = 0;
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
return __lgamma_r_finite (__d, &__local_signgam);
# endif
}
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
#if defined __USE_ISOC99 && defined __extern_always_inline
__extern_always_inline float __NTH (lgammaf (float __d))
{
Fix finite-math-only lgamma functions signgam setting (bug 19211). The lgamma inline functions in bits/math-finite.h do not set signgam if __USE_ISOC99, even when other feature test macros mean a standard such as XSI POSIX is selected for which it should be set. (This is essentially the opposite issue to bug 15421, the out-of-line versions setting signgam even when they shouldn't.) This patch fixes those functions to use __USE_MISC || __USE_XOPEN as the condition for when to set signgam, since it's the condition for when math.h declares signgam. The legacy gamma* names are only declared at all if __USE_MISC || __USE_XOPEN, so they just set signgam unconditionally. Tests for certain standards or not using _GNU_SOURCE cannot use test-skeleton.c (this is a known issue noted on the wiki todo list). Thus, the new tests that signgam remains not set in ISO C modes do not use test-skeleton.c. They also define _ISOMAC to avoid running into declarations in the internal include/ headers that only work in _GNU_SOURCE mode. Tested for x86_64 and x86. [BZ #19211] * math/bits/math-finite.h (lgamma): Set signgam if [__USE_MISC || __USE_XOPEN], not if [!__USE_ISOC99]. (lgammaf): Likewise. (lgammal): Likewise. (gamma): Set signgam unconditionally, not if [!__USE_ISOC99]. (gammaf): Likewise. (gammal): Likewise. * math/test-signgam-finite-c11.c: New file. * math/test-signgam-finite-c99.c: Likewise. * math/test-signgam-finite.c: Likewise. * math/Makefile (tests): Add test-signgam-finite, test-signgam-finite-c99 and test-signgam-finite-c11. (CFLAGS-test-signgam-finite.c): New variable. (CFLAGS-test-signgam-finite-c99.c): Likewise. (CFLAGS-test-signgam-finite-c11.c): Likewise.
2015-11-05 22:23:07 +01:00
# if defined __USE_MISC || defined __USE_XOPEN
return __lgammaf_r_finite (__d, &signgam);
# else
int __local_signgam = 0;
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
return __lgammaf_r_finite (__d, &__local_signgam);
# endif
}
# ifdef __MATH_DECLARE_LDOUBLE
__extern_always_inline long double __NTH (lgammal (long double __d))
{
Fix finite-math-only lgamma functions signgam setting (bug 19211). The lgamma inline functions in bits/math-finite.h do not set signgam if __USE_ISOC99, even when other feature test macros mean a standard such as XSI POSIX is selected for which it should be set. (This is essentially the opposite issue to bug 15421, the out-of-line versions setting signgam even when they shouldn't.) This patch fixes those functions to use __USE_MISC || __USE_XOPEN as the condition for when to set signgam, since it's the condition for when math.h declares signgam. The legacy gamma* names are only declared at all if __USE_MISC || __USE_XOPEN, so they just set signgam unconditionally. Tests for certain standards or not using _GNU_SOURCE cannot use test-skeleton.c (this is a known issue noted on the wiki todo list). Thus, the new tests that signgam remains not set in ISO C modes do not use test-skeleton.c. They also define _ISOMAC to avoid running into declarations in the internal include/ headers that only work in _GNU_SOURCE mode. Tested for x86_64 and x86. [BZ #19211] * math/bits/math-finite.h (lgamma): Set signgam if [__USE_MISC || __USE_XOPEN], not if [!__USE_ISOC99]. (lgammaf): Likewise. (lgammal): Likewise. (gamma): Set signgam unconditionally, not if [!__USE_ISOC99]. (gammaf): Likewise. (gammal): Likewise. * math/test-signgam-finite-c11.c: New file. * math/test-signgam-finite-c99.c: Likewise. * math/test-signgam-finite.c: Likewise. * math/Makefile (tests): Add test-signgam-finite, test-signgam-finite-c99 and test-signgam-finite-c11. (CFLAGS-test-signgam-finite.c): New variable. (CFLAGS-test-signgam-finite-c99.c): Likewise. (CFLAGS-test-signgam-finite-c11.c): Likewise.
2015-11-05 22:23:07 +01:00
# if defined __USE_MISC || defined __USE_XOPEN
return __lgammal_r_finite (__d, &signgam);
# else
int __local_signgam = 0;
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
return __lgammal_r_finite (__d, &__local_signgam);
# endif
}
# endif
#endif
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#if ((defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K)) \
Revert to defining __extern_inline only for gcc-4.3+ (BZ #17266) The check for only __GNUC_STDC_INLINE__ and __GNUC_GNU_INLINE__ may not be sufficient since those flags were added during initial support for C99 inlining semantics. There is also a problem with always defining __extern_inline and __extern_always_inline, since it enables inline wrapper functions even when GNU inlining semantics are not guaranteed. This, along with the possibility of such wrappers using redirection (btowc for example) could result in compiler generating an infinitely recusrive call to the function. In fact it was such a recursion that led to this code being written the way it was; see: https://bugzilla.redhat.com/show_bug.cgi?id=186410 The initial change was to fix bugs 14530 and 13741, but they can be resolved by checking if __fortify_function and/or __extern_always_inline are defined, as it has been done in this patch. In addition, I have audited uses of __extern_always_inline to make sure that none of the uses result in compilation errors. There is however a regression in this patch for llvm, since it reverts the llvm expectation that __GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE__ definition imply proper extern inline semantics. 2014-09-16 Siddhesh Poyarekar <siddhesh@redhat.com> Jakub Jelinek <jakub@redhat.com> [BZ #17266] * libio/stdio.h: Check definition of __fortify_function instead of __extern_always_inline to include bits/stdio2.h. * math/bits/math-finite.h [__USE_XOPEN || __USE_ISOC99]: Also check if __extern_always_inline is defined. [__USE_MISC || __USE_XOPEN]: Likewise. [__USE_ISOC99] Likewise. * misc/sys/cdefs.h (__fortify_function): Define only if __extern_always_inline is defined. [!__cplusplus || __GNUC_PREREQ (4,3)]: Revert to defining __extern_always_inline and __extern_inline only for g++-4.3 and newer or a compatible gcc.
2014-09-16 10:38:48 +02:00
&& defined __extern_always_inline)
/* gamma. */
__extern_always_inline double __NTH (gamma (double __d))
{
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
return __lgamma_r_finite (__d, &signgam);
}
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# ifdef __USE_ISOC99
__extern_always_inline float __NTH (gammaf (float __d))
{
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
return __lgammaf_r_finite (__d, &signgam);
}
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# ifdef __MATH_DECLARE_LDOUBLE
__extern_always_inline long double __NTH (gammal (long double __d))
{
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
return __lgammal_r_finite (__d, &signgam);
}
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# endif
# endif
#endif
/* log. */
extern double __REDIRECT_NTH (log, (double), __log_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#ifdef __USE_ISOC99
extern float __REDIRECT_NTH (logf, (float), __logf_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (logl, (long double), __log_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# else
extern long double __REDIRECT_NTH (logl, (long double), __logl_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# endif
# endif
#endif
/* log10. */
extern double __REDIRECT_NTH (log10, (double), __log10_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#ifdef __USE_ISOC99
extern float __REDIRECT_NTH (log10f, (float), __log10f_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (log10l, (long double), __log10_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# else
extern long double __REDIRECT_NTH (log10l, (long double), __log10l_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# endif
# endif
#endif
#ifdef __USE_ISOC99
/* log2. */
extern double __REDIRECT_NTH (log2, (double), __log2_finite);
extern float __REDIRECT_NTH (log2f, (float), __log2f_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (log2l, (long double), __log2_finite);
# else
extern long double __REDIRECT_NTH (log2l, (long double), __log2l_finite);
# endif
# endif
#endif
/* pow. */
extern double __REDIRECT_NTH (pow, (double, double), __pow_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#ifdef __USE_ISOC99
extern float __REDIRECT_NTH (powf, (float, float), __powf_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (powl, (long double, long double),
__pow_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# else
extern long double __REDIRECT_NTH (powl, (long double, long double),
__powl_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# endif
# endif
#endif
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
/* remainder. */
extern double __REDIRECT_NTH (remainder, (double, double), __remainder_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
#ifdef __USE_ISOC99
extern float __REDIRECT_NTH (remainderf, (float, float), __remainderf_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (remainderl, (long double, long double),
__remainder_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# else
extern long double __REDIRECT_NTH (remainderl, (long double, long double),
__remainderl_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# endif
# endif
#endif
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#if (defined __USE_MISC \
|| (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K8))
/* scalb. */
extern double __REDIRECT_NTH (scalb, (double, double), __scalb_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#endif
#if defined __USE_MISC && defined __USE_ISOC99
extern float __REDIRECT_NTH (scalbf, (float, float), __scalbf_finite);
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (scalbl, (long double, long double),
__scalb_finite);
# else
extern long double __REDIRECT_NTH (scalbl, (long double, long double),
__scalbl_finite);
# endif
# endif
#endif
/* sinh. */
extern double __REDIRECT_NTH (sinh, (double), __sinh_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#ifdef __USE_ISOC99
extern float __REDIRECT_NTH (sinhf, (float), __sinhf_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (sinhl, (long double), __sinh_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# else
extern long double __REDIRECT_NTH (sinhl, (long double), __sinhl_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# endif
# endif
#endif
/* sqrt. */
extern double __REDIRECT_NTH (sqrt, (double), __sqrt_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
#ifdef __USE_ISOC99
extern float __REDIRECT_NTH (sqrtf, (float), __sqrtf_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# ifdef __MATH_DECLARE_LDOUBLE
# ifdef __NO_LONG_DOUBLE_MATH
extern long double __REDIRECT_NTH (sqrtl, (long double), __sqrt_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# else
extern long double __REDIRECT_NTH (sqrtl, (long double), __sqrtl_finite);
Make bits/math-finite.h conditions match other headers (bug 19205). bits/math-finite.h declares -ffinite-math-only variants of various functions under conditions not matching those under which the normal versions are declared. * math.h only ever includes bits/mathcalls.h to declare float and long double functions if __USE_ISOC99, but bits/math-finite.h declares some float functions regardless (long double ones are conditioned on __MATH_DECLARE_LDOUBLE). (For C90 functions this isn't a conformance bug because C90 reserves the float and long double names, but is still contrary to good glibc practice. For some other functions in older XSI standards it *is* a conformance bug.) * Some functions are defined as inlines using lgamma_r functions under conditions where those lgamma_r functions are not themselves declared. * hypot is declared under __USE_XOPEN || __USE_ISOC99 in bits/mathcalls.h, __USE_ISOC99 only in bits/math-finite.h. * float and long double versions of Bessel functions should be limited to __USE_MISC (as in bug 18977). * gamma should not be declared for __USE_XOPEN2K (as in bug 18967). * remainder should be restricted to __USE_XOPEN_EXTENDED || __USE_ISOC99, not unconditional. * scalb should not be declared for __USE_XOPEN2K8, and scalbf and scalbl are non-POSIX (as in bug 18967). This patch fixes all these issues (it doesn't seem worth splitting them into separate patches or bugs). I put __USE_ISOC99 conditionals, where needed, around both float and long double declarations, even though formally redundant around the long double declarations because __MATH_DECLARE_LDOUBLE isn't defined without __USE_ISOC99; it seemed clearer that way. The missing declarations of lgamma_r functions are dealt with by directly using declarations of __lgamma*_r_finite, in the implementation namespace, rather than having the inlines rely on asm redirection of lgamma*_r. After this patch, there are some apparently redundant nested __USE_ISOC99 conditionals in lgamma / gamma definitions. These actually reflect a separate bug (the correct condition for the lgamma inline functions to set signgam is __USE_MISC || __USE_XOPEN, the condition under which signgam is declared, rather than disabling setting it if __USE_ISOC99, which includes XSI POSIX versions for which signgam *should* be set). They'll be fixed as part of a fix for that bug, which will also add tests for these inlines. I've put a note about more general conform/ test coverage for -ffinite-math-only on <https://sourceware.org/glibc/wiki/Development_Todo/Master#conformtest_improvements>, alongside other options for which this is also relevant (some of which have also had such bugs in the past relating to mismatched conditionals). I also intend to enable the main libm-test.inc tests for the math-finite.h functions, but some other bugs in __*_finite need fixing first. [BZ #19205] * math/bits/math-finite.h (acosf): Condition declaration on [__USE_ISOC99]. (acosl): Likewise. (acoshf): Likewise. (acoshl): Likewise. (asinf): Likewise. (asinl): Likewise. (atan2f): Likewise. (atan2l): Likewise. (atanhf): Likewise. (atanhl): Likewise. (coshf): Likewise. (coshl): Likewise. (expf): Likewise. (expl): Likewise. (fmodf): Likewise. (fmodl): Likewise. (hypot): Change condition to [__USE_XOPEN || __USE_ISOC99]. (j0f): Change condition to [__USE_MISC && __USE_ISOC99]. (j0l): Likewise. (y0f): Likewise. (y0l): Likewise. (j1f): Likewise. (j1l): Likewise. (y1f): Likewise. (y1l): Likewise. (jnf): Likewise. (jnl): Likewise. (ynf): Likewise. (ynl): Likewise. (lgammaf_r): Condition declaration on [__USE_ISOC99]. (lgammal_r): Likewise. (__lgamma_r_finite): New declaration. (__lgammaf_r_finite): Likewise. (__lgammal_r_finite): Likewise. (lgamma): Use __lgamma_r_finite. (lgammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (lgammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (gamma): Do not define for [!__USE_MISC && __USE_XOPEN2K]. Use __lgamma_r_finite. (gammaf): Condition definition on [__USE_ISOC99]. Use __lgammaf_r_finite. (gammal): Condition definition on [__USE_ISOC99]. Use __lgammal_r_finite. (logf): Condition declaration on [__USE_ISOC99]. (logl): Likewise. (log10f): Likewise. (log10l): Likewise. (ldexpf): Likewise. (ldexpl): Likewise. (powf): Likewise. (powl): Likewise. (remainder): Condition declaration on [__USE_XOPEN_EXTENDED || __USE_ISOC99]. (remainderf): Condition declaration on [__USE_ISOC99]. (remainderl): Likewise. (scalb): Do not declare for [!__USE_MISC && __USE_XOPEN2K8]. (scalbf): Change condition to [__USE_MISC && __USE_ISOC99]. (scalbl): Likewise. (sinhf): Condition declaration on [__USE_ISOC99]. (sinhl): Likewise. (sqrtf): Likewise. (sqrtl): Likewise.
2015-11-05 01:48:57 +01:00
# endif
# endif
#endif
Revert to defining __extern_inline only for gcc-4.3+ (BZ #17266) The check for only __GNUC_STDC_INLINE__ and __GNUC_GNU_INLINE__ may not be sufficient since those flags were added during initial support for C99 inlining semantics. There is also a problem with always defining __extern_inline and __extern_always_inline, since it enables inline wrapper functions even when GNU inlining semantics are not guaranteed. This, along with the possibility of such wrappers using redirection (btowc for example) could result in compiler generating an infinitely recusrive call to the function. In fact it was such a recursion that led to this code being written the way it was; see: https://bugzilla.redhat.com/show_bug.cgi?id=186410 The initial change was to fix bugs 14530 and 13741, but they can be resolved by checking if __fortify_function and/or __extern_always_inline are defined, as it has been done in this patch. In addition, I have audited uses of __extern_always_inline to make sure that none of the uses result in compilation errors. There is however a regression in this patch for llvm, since it reverts the llvm expectation that __GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE__ definition imply proper extern inline semantics. 2014-09-16 Siddhesh Poyarekar <siddhesh@redhat.com> Jakub Jelinek <jakub@redhat.com> [BZ #17266] * libio/stdio.h: Check definition of __fortify_function instead of __extern_always_inline to include bits/stdio2.h. * math/bits/math-finite.h [__USE_XOPEN || __USE_ISOC99]: Also check if __extern_always_inline is defined. [__USE_MISC || __USE_XOPEN]: Likewise. [__USE_ISOC99] Likewise. * misc/sys/cdefs.h (__fortify_function): Define only if __extern_always_inline is defined. [!__cplusplus || __GNUC_PREREQ (4,3)]: Revert to defining __extern_always_inline and __extern_inline only for g++-4.3 and newer or a compatible gcc.
2014-09-16 10:38:48 +02:00
#if defined __USE_ISOC99 && defined __extern_always_inline
/* tgamma. */
extern double __gamma_r_finite (double, int *);
__extern_always_inline double __NTH (tgamma (double __d))
{
int __local_signgam = 0;
double __res = __gamma_r_finite (__d, &__local_signgam);
return __local_signgam < 0 ? -__res : __res;
}
extern float __gammaf_r_finite (float, int *);
__extern_always_inline float __NTH (tgammaf (float __d))
{
int __local_signgam = 0;
float __res = __gammaf_r_finite (__d, &__local_signgam);
return __local_signgam < 0 ? -__res : __res;
}
# ifdef __MATH_DECLARE_LDOUBLE
extern long double __gammal_r_finite (long double, int *);
__extern_always_inline long double __NTH (tgammal (long double __d))
{
int __local_signgam = 0;
# ifdef __NO_LONG_DOUBLE_MATH
long double __res = __gamma_r_finite (__d, &__local_signgam);
# else
long double __res = __gammal_r_finite (__d, &__local_signgam);
# endif
return __local_signgam < 0 ? -__res : __res;
}
# endif
#endif