From 0d5aa03bb1256279569d8e825e3a7531b2dd2f32 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 29 Jun 2007 01:55:08 +0000 Subject: [PATCH] Under gcc, declare k5_v?asprintf with format attribute git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19654 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/k5-platform.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/k5-platform.h b/src/include/k5-platform.h index b1b078108..2339e6354 100644 --- a/src/include/k5-platform.h +++ b/src/include/k5-platform.h @@ -793,6 +793,14 @@ vsnprintf(char *str, size_t size, const char *format, va_list args) #endif /* win32? */ #endif /* no vsnprintf */ #ifndef HAVE_VASPRINTF + +#if !defined(__cplusplus) && (__GNUC__ > 2) +static inline int k5_vasprintf(char **, const char *, va_list) + __attribute__((__format__(__printf__, 2, 0))); +static inline int k5_asprintf(char **, const char *, ...) + __attribute__((__format__(__printf__, 2, 3))); +#endif + #define vasprintf k5_vasprintf /* On error: BSD: Set *ret to NULL. GNU: *ret is undefined. -- 2.26.2