mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Add GCC annotations so that the vsprintf functions get checked properly
This commit is contained in:
parent
60f6540341
commit
117e3273dc
@ -488,7 +488,11 @@ int evbuffer_add_printf(struct evbuffer *buf, const char *fmt, ...)
|
||||
@param ap a varargs va_list argument array that will be passed to vprintf(3)
|
||||
@return The number of bytes added if successful, or -1 if an error occurred.
|
||||
*/
|
||||
int evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap);
|
||||
int evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap)
|
||||
#ifdef __GNUC__
|
||||
__attribute__((format(printf, 2, 0)))
|
||||
#endif
|
||||
;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user