diff buf.h @ 133:d85dd98cb49d

Add attributes
author David Demelier <markand@malikania.fr>
date Mon, 12 Mar 2012 21:46:45 +0100
parents cbfad4fb80c8
children 07800b7af208
line wrap: on
line diff
--- a/buf.h	Mon Mar 12 21:46:39 2012 +0100
+++ b/buf.h	Mon Mar 12 21:46:45 2012 +0100
@@ -31,6 +31,10 @@
 
 #ifdef __GNUC__
 #  define _buf_at_printf(i1, i2)	__attribute__ ((format (printf, i1, i2)))
+#    if __GNUC_MINOR__ > 2
+#      pragma GCC diagnostic push
+#      pragma GCC diagnostic warning "-Wformat"
+#    endif
 #else
 #  define _buf_at_printf(i1, i2)
 #endif
@@ -53,15 +57,39 @@
 	void * (*realloc)(void *, size_t);
 };
 
-int	buf_init(struct buf *);
-void	buf_set(struct buf *, const char *, ...);
-int	buf_ncat(struct buf *, const char *, size_t);
-int	buf_copy(struct buf *, const char *);
-int	buf_vprintf(struct buf *, const char *, va_list);
-int	buf_printf(struct buf *, const char *, ...) _buf_at_printf(2, 3);
-int	buf_putc(struct buf *, int);
-void	buf_clear(struct buf *);
-void	buf_free(struct buf *);
+int
+buf_init(struct buf *);
+
+void
+buf_set(struct buf *, const char *, ...);
+
+int
+buf_ncat(struct buf *, const char *, size_t);
+
+int
+buf_cat(struct buf *, const char *);
+
+int
+buf_putc(struct buf *, int);
+
+int
+buf_vprintf(struct buf *, const char *, va_list);
+
+int
+buf_printf(struct buf *, const char *, ...)	_buf_at_printf(2, 3);
+
+int
+buf_trim(struct buf *);
+
+void
+buf_clear(struct buf *);
+
+void
+buf_free(struct buf *);
+
+#if defined(__GNUC__) && __GNUC_MINOR__ > 2
+#  pragma GCC diagnostic pop
+#endif
 
 #ifdef __cplusplus
 }