From a2df1ef4413144fe7d09a22f4750df05e83c13fb Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Mon, 25 Jun 2018 11:48:58 -0700 Subject: Do not customize __format__ for Windows/MinGW to gnu_printf Bug: http://b/69933090 Bug: http://b/69933068 MinGW uses gnu_printf to force C99 printf analysis with GCC, but clang does not support gnu_printf. So just use the default that's used for other platforms. This also mirrors upstream commit https://sourceforge.net/p/mingw-w64/mingw-w64/ci/015e637b4b24d9915162ab877ed539ad0e657951/. Test: m native-host-cross with Clang. Change-Id: I3deb266d70e25296c4ae1d58637afbabc3d949c1 --- base/include/android-base/stringprintf.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'base/include/android-base/stringprintf.h') diff --git a/base/include/android-base/stringprintf.h b/base/include/android-base/stringprintf.h index 1fd6297fde..517e69e179 100644 --- a/base/include/android-base/stringprintf.h +++ b/base/include/android-base/stringprintf.h @@ -24,17 +24,8 @@ namespace android { namespace base { // These printf-like functions are implemented in terms of vsnprintf, so they -// use the same attribute for compile-time format string checking. On Windows, -// if the mingw version of vsnprintf is used, use `gnu_printf' which allows z -// in %zd and PRIu64 (and related) to be recognized by the compile-time -// checking. +// use the same attribute for compile-time format string checking. #define ANDROID_BASE_FORMAT_ARCHETYPE __printf__ -#ifdef __USE_MINGW_ANSI_STDIO -#if __USE_MINGW_ANSI_STDIO -#undef ANDROID_BASE_FORMAT_ARCHETYPE -#define ANDROID_BASE_FORMAT_ARCHETYPE gnu_printf -#endif -#endif // Returns a string corresponding to printf-like formatting of the arguments. std::string StringPrintf(const char* fmt, ...) -- cgit v1.2.3