From 53f59456090ceec2bf4ff0ecf5634c1d3eaa70c8 Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Tue, 18 Sep 2018 14:58:17 -0700 Subject: [PATCH] Do not enable -Wold-style-cast for Windows Bug: http://b/91353691 Enable -Wold-style-cast only for non-Windows targets. _islower_l, _isupper_l etc. in MinGW locale_win32.h (included from libcxx/include/__locale) have an old-style-cast. Test: Build and test Windows modules under Wine. Change-Id: Ib7594559a43096885b0cc1c656cf59db8b52d38b --- libziparchive/Android.bp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libziparchive/Android.bp b/libziparchive/Android.bp index fd3f60290..3308adf37 100644 --- a/libziparchive/Android.bp +++ b/libziparchive/Android.bp @@ -23,11 +23,21 @@ cc_defaults { "-D_FILE_OFFSET_BITS=64", ], cppflags: [ - "-Wold-style-cast", // Incorrectly warns when C++11 empty brace {} initializer is used. // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61489 "-Wno-missing-field-initializers", ], + + // Enable -Wold-style-cast only for non-Windows targets. _islower_l, + // _isupper_l etc. in MinGW locale_win32.h (included from + // libcxx/include/__locale) has an old-style-cast. + target: { + not_windows: { + cppflags: [ + "-Wold-style-cast", + ], + }, + }, } cc_defaults {