diff options
author | Elliott Hughes <enh@google.com> | 2014-05-05 20:28:28 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-05-05 21:19:47 -0700 |
commit | 9a5a3e8e74e2c6d7850ab29711189acf0f7378a2 (patch) | |
tree | 54310a7a9d342c88ce8f8073b6b90e675641af19 /libc | |
parent | 185dd72a2c487502717903065e46d14039f17826 (diff) | |
download | bionic-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 'libc')
-rw-r--r-- | libc/Android.mk | 5 | ||||
-rw-r--r-- | libc/tzcode/strftime.c | 2 | ||||
-rw-r--r-- | libc/upstream-openbsd/android/include/openbsd-compat.h | 1 |
3 files changed, 6 insertions, 2 deletions
diff --git a/libc/Android.mk b/libc/Android.mk index 4b81f7e..2ec1281 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 2a1db64..967629d 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 b55f390..bacd1d7 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 <ctype.h> uses these names, which conflicted with stlport. |