changeset 132:bdd511d1a556

Add attributes
author David Demelier <markand@malikania.fr>
date Mon, 12 Mar 2012 21:46:39 +0100
parents cbfad4fb80c8
children d85dd98cb49d
files port/asprintf.h
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/port/asprintf.h	Sun Mar 11 23:37:57 2012 +0100
+++ b/port/asprintf.h	Mon Mar 12 21:46:39 2012 +0100
@@ -22,7 +22,13 @@
 extern "C" {
 #endif
 
-int	asprintf(char **, const char *, ...);
+#ifdef __GNUC__
+#  define _asp_at_printf(i1, i2)	__attribute__ ((format (printf, i1, i2)))
+#else
+#  define _asp_at_printf(i1, i2)
+#endif
+
+int	asprintf(char **, const char *, ...) _asp_at_printf(2, 3);
 int	vasprintf(char **, const char *, va_list);
 
 #ifdef __cplusplus