diff --git a/libgphoto2_port/gphoto2/gphoto2-port-log.h b/libgphoto2_port/gphoto2/gphoto2-port-log.h index c02408980..c3b20c0c4 100644 --- a/libgphoto2_port/gphoto2/gphoto2-port-log.h +++ b/libgphoto2_port/gphoto2/gphoto2-port-log.h @@ -212,12 +212,18 @@ __attribute__((__format__(printf,4,5))) gpi_string_list_to_flags(const char *str[], const StringFlagItem *map); - /* Allocates a sufficiently large buffer and interpolates the format - * string with the proveded va_list args. The returned memory has to - * be freed by the caller. */ - char* - gpi_vsnprintf (const char* format, va_list args); +/* Allocates a sufficiently large buffer and interpolates the format +* string with the proveded va_list args. The returned memory has to +* be freed by the caller. */ +#ifdef __GNUC__ +__attribute__((__format__(printf,1,0))) +#endif +char* +gpi_vsnprintf (const char* format, va_list args); +#ifdef __GNUC__ +__attribute__((__format__(printf,1,2))) +#endif static inline char* aprintf(const char *fmt, ...) {