summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorElliott Hughes2018-06-26 15:06:15 -0500
committerElliott Hughes2018-06-26 15:07:21 -0500
commitd8a4c60276667f6f08d02314da4eb6f0f741fb5d (patch)
treea1e47bcb7c2101647ef4f5bcb6b23c75a1730bf2 /base
parentb8f4fe4fd46fb9c5e1f53d4f3fcc87c7bd63ee7d (diff)
downloadplatform-system-core-d8a4c60276667f6f08d02314da4eb6f0f741fb5d.tar.gz
platform-system-core-d8a4c60276667f6f08d02314da4eb6f0f741fb5d.tar.xz
platform-system-core-d8a4c60276667f6f08d02314da4eb6f0f741fb5d.zip
Simplify __attribute__((__printf__)) use.
We don't need this now everyone's using clang... Bug: http://b/69933068 Test: ran tests Change-Id: I88f0cf03981ade47e210387fd6f3a2706dfeb9b8
Diffstat (limited to 'base')
-rw-r--r--base/include/android-base/stringprintf.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/base/include/android-base/stringprintf.h b/base/include/android-base/stringprintf.h
index 517e69e17..c13d25d37 100644
--- a/base/include/android-base/stringprintf.h
+++ b/base/include/android-base/stringprintf.h
@@ -25,21 +25,17 @@ namespace 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. 27// use the same attribute for compile-time format string checking.
28#define ANDROID_BASE_FORMAT_ARCHETYPE __printf__
29 28
30// Returns a string corresponding to printf-like formatting of the arguments. 29// Returns a string corresponding to printf-like formatting of the arguments.
31std::string StringPrintf(const char* fmt, ...) 30std::string StringPrintf(const char* fmt, ...) __attribute__((__format__(__printf__, 1, 2)));
32 __attribute__((__format__(ANDROID_BASE_FORMAT_ARCHETYPE, 1, 2)));
33 31
34// Appends a printf-like formatting of the arguments to 'dst'. 32// Appends a printf-like formatting of the arguments to 'dst'.
35void StringAppendF(std::string* dst, const char* fmt, ...) 33void StringAppendF(std::string* dst, const char* fmt, ...)
36 __attribute__((__format__(ANDROID_BASE_FORMAT_ARCHETYPE, 2, 3))); 34 __attribute__((__format__(__printf__, 2, 3)));
37 35
38// Appends a printf-like formatting of the arguments to 'dst'. 36// Appends a printf-like formatting of the arguments to 'dst'.
39void StringAppendV(std::string* dst, const char* format, va_list ap) 37void StringAppendV(std::string* dst, const char* format, va_list ap)
40 __attribute__((__format__(ANDROID_BASE_FORMAT_ARCHETYPE, 2, 0))); 38 __attribute__((__format__(__printf__, 2, 0)));
41
42#undef ANDROID_BASE_FORMAT_ARCHETYPE
43 39
44} // namespace base 40} // namespace base
45} // namespace android 41} // namespace android