summaryrefslogtreecommitdiffstats
path: root/libm
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-05-05 20:28:28 -0700
committerElliott Hughes <enh@google.com>2014-05-05 21:19:47 -0700
commit9a5a3e8e74e2c6d7850ab29711189acf0f7378a2 (patch)
tree54310a7a9d342c88ce8f8073b6b90e675641af19 /libm
parent185dd72a2c487502717903065e46d14039f17826 (diff)
downloadbionic-9a5a3e8e74e2c6d7850ab29711189acf0f7378a2.zip
bionic-9a5a3e8e74e2c6d7850ab29711189acf0f7378a2.tar.gz
bionic-9a5a3e8e74e2c6d7850ab29711189acf0f7378a2.tar.bz2
Fix <math.h> to quieten most of our warnings.
I've reported the wcsftime bug upstream, but we really just want to use -D to ensure the buggy code isn't built. (I've also brought our strftime a bit closer to upstream now we have the right define.) I don't think upstream is likely to fix all their sign-compare and uninitialized warnings, so let's just silence them. As for libm, again upstream isn't likely to fix all their warnings, and silencing those made the ones that were our fault stand out. I've fixed our <math.h> to fix the warnings caused by our lack of definitions for the non-imprecise long-double functions. I checked the C99 standard, and all these functions are there. Change-Id: Iee8e1182c1db375058fb2c451eceb212bab47a37
Diffstat (limited to 'libm')
-rw-r--r--libm/Android.mk5
-rw-r--r--libm/include/math.h51
2 files changed, 21 insertions, 35 deletions
diff --git a/libm/Android.mk b/libm/Android.mk
index 5f69d1e..d7d8bc1 100644
--- a/libm/Android.mk
+++ b/libm/Android.mk
@@ -234,6 +234,11 @@ libm_common_cflags := \
-DFLT_EVAL_METHOD=0 \
-std=c99 \
-include $(LOCAL_PATH)/freebsd-compat.h \
+ -Wno-missing-braces \
+ -Wno-parentheses \
+ -Wno-sign-compare \
+ -Wno-uninitialized \
+ -Wno-unknown-pragmas \
libm_common_includes := $(LOCAL_PATH)/upstream-freebsd/lib/msun/src/
diff --git a/libm/include/math.h b/libm/include/math.h
index bd0241b..4d174f9 100644
--- a/libm/include/math.h
+++ b/libm/include/math.h
@@ -396,16 +396,23 @@ float significandf(float);
* long double versions of ISO/POSIX math functions
*/
#if __ISO_C_VISIBLE >= 1999
+long double acoshl(long double);
long double acosl(long double);
+long double asinhl(long double);
long double asinl(long double);
long double atan2l(long double, long double);
+long double atanhl(long double);
long double atanl(long double);
long double cbrtl(long double);
long double ceill(long double);
long double copysignl(long double, long double) __pure2;
+long double coshl(long double);
long double cosl(long double);
+long double erfcl(long double);
+long double erfl(long double);
long double exp2l(long double);
long double expl(long double);
+long double expm1l(long double);
long double fabsl(long double) __pure2;
long double fdiml(long double, long double);
long double floorl(long double);
@@ -417,9 +424,14 @@ long double frexpl(long double value, int *); /* fundamentally !__pure2 */
long double hypotl(long double, long double);
int ilogbl(long double) __pure2;
long double ldexpl(long double, int);
+long double lgammal(long double);
long long llrintl(long double);
long long llroundl(long double);
+long double log10l(long double);
+long double log1pl(long double);
+long double log2l(long double);
long double logbl(long double);
+long double logl(long double);
long lrintl(long double);
long lroundl(long double);
long double modfl(long double, long double *); /* fundamentally !__pure2 */
@@ -429,53 +441,22 @@ long double nextafterl(long double, long double);
double nexttoward(double, long double);
float nexttowardf(float, long double);
long double nexttowardl(long double, long double);
+long double powl(long double, long double);
long double remainderl(long double, long double);
long double remquol(long double, long double, int *);
long double rintl(long double);
long double roundl(long double);
long double scalblnl(long double, long);
long double scalbnl(long double, int);
+long double sinhl(long double);
long double sinl(long double);
long double sqrtl(long double);
+long double tanhl(long double);
long double tanl(long double);
+long double tgammal(long double);
long double truncl(long double);
#endif /* __ISO_C_VISIBLE >= 1999 */
__END_DECLS
#endif /* !_MATH_H_ */
-
-/* separate header for cmath */
-#ifndef _MATH_EXTRA_H_
-#if __ISO_C_VISIBLE >= 1999
-#if _DECLARE_C99_LDBL_MATH
-
-#define _MATH_EXTRA_H_
-
-/*
- * extra long double versions of math functions for C99 and cmath
- */
-__BEGIN_DECLS
-
-long double acoshl(long double);
-long double asinhl(long double);
-long double atanhl(long double);
-long double coshl(long double);
-long double erfcl(long double);
-long double erfl(long double);
-long double expm1l(long double);
-long double lgammal(long double);
-long double log10l(long double);
-long double log1pl(long double);
-long double log2l(long double);
-long double logl(long double);
-long double powl(long double, long double);
-long double sinhl(long double);
-long double tanhl(long double);
-long double tgammal(long double);
-
-__END_DECLS
-
-#endif /* !_DECLARE_C99_LDBL_MATH */
-#endif /* __ISO_C_VISIBLE >= 1999 */
-#endif /* !_MATH_EXTRA_H_ */