diff --git a/libc/Android.mk b/libc/Android.mk index 4b81f7e46..2ec12811c 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -568,6 +568,7 @@ LOCAL_CFLAGS += -DTM_GMTOFF=tm_gmtoff LOCAL_CFLAGS += -DTZDIR=\"/system/usr/share/zoneinfo\" # Include timezone and daylight globals. LOCAL_CFLAGS += -DUSG_COMPAT=1 +LOCAL_CFLAGS += -DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU LOCAL_CONLYFLAGS := $(libc_common_conlyflags) LOCAL_CPPFLAGS := $(libc_common_cppflags) @@ -618,6 +619,7 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(libc_upstream_freebsd_src_files) LOCAL_CFLAGS := \ $(libc_common_cflags) \ + -Wno-sign-compare -Wno-uninitialized \ -I$(LOCAL_PATH)/upstream-freebsd/android/include \ -I$(LOCAL_PATH)/upstream-freebsd/lib/libc/include \ -include freebsd-compat.h @@ -644,6 +646,7 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(libc_upstream_netbsd_src_files) LOCAL_CFLAGS := \ $(libc_common_cflags) \ + -Wno-sign-compare -Wno-uninitialized \ -DPOSIX_MISTAKE \ -I$(LOCAL_PATH)/upstream-netbsd/android/include \ -I$(LOCAL_PATH)/upstream-netbsd/lib/libc/include \ @@ -671,6 +674,7 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(libc_upstream_openbsd_src_files) LOCAL_CFLAGS := \ $(libc_common_cflags) \ + -Wno-sign-compare -Wno-uninitialized \ -I$(LOCAL_PATH)/upstream-openbsd/android/include \ -I$(LOCAL_PATH)/upstream-openbsd/lib/libc/include \ -I$(LOCAL_PATH)/upstream-openbsd/lib/libc/gdtoa/ \ @@ -699,6 +703,7 @@ LOCAL_SRC_FILES_32 := $(libc_upstream_openbsd_gdtoa_src_files_32) LOCAL_SRC_FILES_64 := $(libc_upstream_openbsd_gdtoa_src_files_64) LOCAL_CFLAGS := \ $(libc_common_cflags) \ + -Wno-sign-compare -Wno-uninitialized \ -fvisibility=hidden \ -I$(LOCAL_PATH)/upstream-openbsd/android/include \ -I$(LOCAL_PATH)/upstream-openbsd/lib/libc/include \ diff --git a/libc/tzcode/strftime.c b/libc/tzcode/strftime.c index 2a1db6422..967629de6 100644 --- a/libc/tzcode/strftime.c +++ b/libc/tzcode/strftime.c @@ -160,7 +160,7 @@ const struct strftime_locale *locale; tzset(); warn = IN_NONE; p = _fmt(((format == NULL) ? "%c" : format), t, s, s + maxsize, &warn, locale); -#if 0 /* ifndef NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU */ +#ifndef NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU if (warn != IN_NONE && getenv(YEAR_2000_NAME) != NULL) { (void) fprintf(stderr, "\n"); if (format == NULL) diff --git a/libc/upstream-openbsd/android/include/openbsd-compat.h b/libc/upstream-openbsd/android/include/openbsd-compat.h index b55f39050..bacd1d7dd 100644 --- a/libc/upstream-openbsd/android/include/openbsd-compat.h +++ b/libc/upstream-openbsd/android/include/openbsd-compat.h @@ -17,7 +17,6 @@ #ifndef _BIONIC_OPENBSD_COMPAT_H_included #define _BIONIC_OPENBSD_COMPAT_H_included -#define _GNU_SOURCE #define __USE_BSD /* OpenBSD's uses these names, which conflicted with stlport. diff --git a/libm/Android.mk b/libm/Android.mk index 5f69d1ef1..d7d8bc1e9 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 bd0241b36..4d174f931 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_ */ diff --git a/tests/math_test.cpp b/tests/math_test.cpp index 0b98e40f3..63ac71977 100644 --- a/tests/math_test.cpp +++ b/tests/math_test.cpp @@ -14,8 +14,6 @@ * limitations under the License. */ -#define _DECLARE_C99_LDBL_MATH 1 - // This include (and the associated definition of __test_capture_signbit) // must be placed before any files that include (gtest.h in this case). //