summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorPirama Arumuga Nainar2018-06-25 13:48:58 -0500
committerPirama Arumuga Nainar2018-06-25 13:52:54 -0500
commita2df1ef4413144fe7d09a22f4750df05e83c13fb (patch)
tree703bdbfdcb8acbe75e5dfb13f492030fa72eb322 /base
parent8e52362e45c7d14d30c158e3c5f05e53e499bea4 (diff)
downloadplatform-system-core-a2df1ef4413144fe7d09a22f4750df05e83c13fb.tar.gz
platform-system-core-a2df1ef4413144fe7d09a22f4750df05e83c13fb.tar.xz
platform-system-core-a2df1ef4413144fe7d09a22f4750df05e83c13fb.zip
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
Diffstat (limited to 'base')
-rw-r--r--base/include/android-base/stringprintf.h11
1 files changed, 1 insertions, 10 deletions
diff --git a/base/include/android-base/stringprintf.h b/base/include/android-base/stringprintf.h
index 1fd6297fd..517e69e17 100644
--- a/base/include/android-base/stringprintf.h
+++ b/base/include/android-base/stringprintf.h
@@ -24,17 +24,8 @@ namespace android {
24namespace base { 24namespace base {
25 25
26// These printf-like functions are implemented in terms of vsnprintf, so they 26// These printf-like functions are implemented in terms of vsnprintf, so they
27// use the same attribute for compile-time format string checking. On Windows, 27// use the same attribute for compile-time format string checking.
28// if the mingw version of vsnprintf is used, use `gnu_printf' which allows z
29// in %zd and PRIu64 (and related) to be recognized by the compile-time
30// checking.
31#define ANDROID_BASE_FORMAT_ARCHETYPE __printf__ 28#define ANDROID_BASE_FORMAT_ARCHETYPE __printf__
32#ifdef __USE_MINGW_ANSI_STDIO
33#if __USE_MINGW_ANSI_STDIO
34#undef ANDROID_BASE_FORMAT_ARCHETYPE
35#define ANDROID_BASE_FORMAT_ARCHETYPE gnu_printf
36#endif
37#endif
38 29
39// Returns a string corresponding to printf-like formatting of the arguments. 30// Returns a string corresponding to printf-like formatting of the arguments.
40std::string StringPrintf(const char* fmt, ...) 31std::string StringPrintf(const char* fmt, ...)