Add gcc-style annotations for printf-like functions.

Bug: None
Change-Id: I37a553d254cb61a882b98b14274c0fdfba039992
Reviewed-on: https://webrtc-review.googlesource.com/33002
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21281}
This commit is contained in:
Niels Möller
2017-12-14 13:30:46 +01:00
committed by Commit Bot
parent 6f772d26ce
commit 00f934abc4
4 changed files with 19 additions and 4 deletions

View File

@ -175,6 +175,10 @@ public:
void QueueString(const char* data) {
QueueData(data, strlen(data));
}
#if defined(__GNUC__)
// Note: Implicit |this| argument counts as the first argument.
__attribute__((__format__(__printf__, 2, 3)))
#endif
void QueueStringF(const char* format, ...) {
va_list args;
va_start(args, format);