summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorElliott Hughes2018-01-09 13:16:55 -0600
committerElliott Hughes2018-01-09 13:18:10 -0600
commit3d7fa22164cdf63ca3f88b8ddd84242fb15c9ba0 (patch)
treed112dd5b4e3038c3c568201f8d975ead6cbc1365 /base
parenta1e27d342e05fc504ce7140463d17336c53a1af8 (diff)
downloadplatform-system-core-3d7fa22164cdf63ca3f88b8ddd84242fb15c9ba0.tar.gz
platform-system-core-3d7fa22164cdf63ca3f88b8ddd84242fb15c9ba0.tar.xz
platform-system-core-3d7fa22164cdf63ca3f88b8ddd84242fb15c9ba0.zip
Add __attribute__((__format__)) to fastboot's die().
Also make the <android-base/stringprintf.h> macro less likely to collide. Bug: N/A Test: builds Change-Id: I868a0a0002c9c53c1ec0670153df2af5f48fd969
Diffstat (limited to 'base')
-rw-r--r--base/include/android-base/stringprintf.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/base/include/android-base/stringprintf.h b/base/include/android-base/stringprintf.h
index cf666abe0..1fd6297fd 100644
--- a/base/include/android-base/stringprintf.h
+++ b/base/include/android-base/stringprintf.h
@@ -28,27 +28,27 @@ namespace base {
28// if the mingw version of vsnprintf is used, use `gnu_printf' which allows z 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 29// in %zd and PRIu64 (and related) to be recognized by the compile-time
30// checking. 30// checking.
31#define FORMAT_ARCHETYPE __printf__ 31#define ANDROID_BASE_FORMAT_ARCHETYPE __printf__
32#ifdef __USE_MINGW_ANSI_STDIO 32#ifdef __USE_MINGW_ANSI_STDIO
33#if __USE_MINGW_ANSI_STDIO 33#if __USE_MINGW_ANSI_STDIO
34#undef FORMAT_ARCHETYPE 34#undef ANDROID_BASE_FORMAT_ARCHETYPE
35#define FORMAT_ARCHETYPE gnu_printf 35#define ANDROID_BASE_FORMAT_ARCHETYPE gnu_printf
36#endif 36#endif
37#endif 37#endif
38 38
39// Returns a string corresponding to printf-like formatting of the arguments. 39// Returns a string corresponding to printf-like formatting of the arguments.
40std::string StringPrintf(const char* fmt, ...) 40std::string StringPrintf(const char* fmt, ...)
41 __attribute__((__format__(FORMAT_ARCHETYPE, 1, 2))); 41 __attribute__((__format__(ANDROID_BASE_FORMAT_ARCHETYPE, 1, 2)));
42 42
43// Appends a printf-like formatting of the arguments to 'dst'. 43// Appends a printf-like formatting of the arguments to 'dst'.
44void StringAppendF(std::string* dst, const char* fmt, ...) 44void StringAppendF(std::string* dst, const char* fmt, ...)
45 __attribute__((__format__(FORMAT_ARCHETYPE, 2, 3))); 45 __attribute__((__format__(ANDROID_BASE_FORMAT_ARCHETYPE, 2, 3)));
46 46
47// Appends a printf-like formatting of the arguments to 'dst'. 47// Appends a printf-like formatting of the arguments to 'dst'.
48void StringAppendV(std::string* dst, const char* format, va_list ap) 48void StringAppendV(std::string* dst, const char* format, va_list ap)
49 __attribute__((__format__(FORMAT_ARCHETYPE, 2, 0))); 49 __attribute__((__format__(ANDROID_BASE_FORMAT_ARCHETYPE, 2, 0)));
50 50
51#undef FORMAT_ARCHETYPE 51#undef ANDROID_BASE_FORMAT_ARCHETYPE
52 52
53} // namespace base 53} // namespace base
54} // namespace android 54} // namespace android