From 8046f4dbe122ac5f362693550360b54cd6943a4b Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Mon, 23 Mar 2015 10:55:05 +0000 Subject: Use compiler pragmas instead of flags. This lets us turn off warnings for a small segment of the code instead of the entire project. bug: 19823499 Change-Id: I9309e9a33bddc33e8c100a49416e95b2a56e2385 --- luni/src/main/native/libcore_icu_NativeIDN.cpp | 9 +++++++++ luni/src/main/native/sub.mk | 3 --- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/luni/src/main/native/libcore_icu_NativeIDN.cpp b/luni/src/main/native/libcore_icu_NativeIDN.cpp index 16a6e1c..43f3ce5 100644 --- a/luni/src/main/native/libcore_icu_NativeIDN.cpp +++ b/luni/src/main/native/libcore_icu_NativeIDN.cpp @@ -39,9 +39,18 @@ static jstring NativeIDN_convertImpl(JNIEnv* env, jclass, jstring javaSrc, jint } UChar dst[256]; UErrorCode status = U_ZERO_ERROR; + + // We're stuck implementing IDNA-2003 for now since that's what we specify. + // + // TODO: Change our spec to IDNA-2008 + UTS-46 compatibility processing if + // it's safe enough. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" size_t resultLength = toAscii ? uidna_IDNToASCII(src.get(), src.size(), &dst[0], sizeof(dst), flags, NULL, &status) : uidna_IDNToUnicode(src.get(), src.size(), &dst[0], sizeof(dst), flags, NULL, &status); +#pragma GCC diagnostic pop + if (U_FAILURE(status)) { jniThrowException(env, "java/lang/IllegalArgumentException", u_errorName(status)); return NULL; diff --git a/luni/src/main/native/sub.mk b/luni/src/main/native/sub.mk index cf2118a..da866a6 100644 --- a/luni/src/main/native/sub.mk +++ b/luni/src/main/native/sub.mk @@ -64,6 +64,3 @@ LOCAL_STATIC_LIBRARIES += \ LOCAL_SHARED_LIBRARIES += \ liblog \ libnativehelper \ - -# Workaround to let libcore_icu_NativeIDN.cpp use the deprecated IDNA2003 API: -LOCAL_CFLAGS += -Wno-deprecated-declarations -- cgit v1.1