summaryrefslogtreecommitdiff
path: root/include/event2/util.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-06-14 13:25:10 -0400
committerNick Mathewson <nickm@torproject.org>2012-06-14 13:25:10 -0400
commit117e3273dce5f6aa61b1867a64c8345b78dc1620 (patch)
tree8c120727d9cd8bd873c9b696eff7c3488f66b81a /include/event2/util.h
parent60f65403412c940f51a10c6e283acea9fe6b79cf (diff)
downloadlibevent-117e3273dce5f6aa61b1867a64c8345b78dc1620.tar.gz
Add GCC annotations so that the vsprintf functions get checked properly
Diffstat (limited to 'include/event2/util.h')
-rw-r--r--include/event2/util.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/event2/util.h b/include/event2/util.h
index 45d8f1de..4b7e8b45 100644
--- a/include/event2/util.h
+++ b/include/event2/util.h
@@ -449,7 +449,11 @@ int evutil_snprintf(char *buf, size_t buflen, const char *format, ...)
/** Replacement for vsnprintf to get consistent behavior on platforms for
which the return value of snprintf does not conform to C99.
*/
-int evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap);
+int evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap)
+#ifdef __GNUC__
+ __attribute__((format(printf, 3, 0)))
+#endif
+;
/** Replacement for inet_ntop for platforms which lack it. */
const char *evutil_inet_ntop(int af, const void *src, char *dst, size_t len);