# define __LA_DECL
#endif
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define __LA_PRINTF(fmtarg, firstvararg) \
+ __attribute__((__format__ (__printf__, fmtarg, firstvararg)))
+#else
+#define __LA_PRINTF(fmtarg, firstvararg) /* nothing */
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
__LA_DECL int archive_format(struct archive *);
__LA_DECL void archive_clear_error(struct archive *);
__LA_DECL void archive_set_error(struct archive *, int _err,
- const char *fmt, ...);
+ const char *fmt, ...) __LA_PRINTF(3, 4);
__LA_DECL void archive_copy_error(struct archive *dest,
struct archive *src);
__LA_DECL int archive_file_count(struct archive *);
#include <wchar.h>
#endif
+#include "archive.h"
+
/*
* Basic resizable/reusable string support a la Java's "StringBuffer."
*
/* Like 'vsprintf', but resizes the underlying string as necessary. */
void __archive_string_vsprintf(struct archive_string *, const char *,
- va_list);
+ va_list) __LA_PRINTF(2, 0);
#define archive_string_vsprintf __archive_string_vsprintf
-void __archive_string_sprintf(struct archive_string *, const char *, ...);
+void __archive_string_sprintf(struct archive_string *, const char *, ...)
+ __LA_PRINTF(2, 3);
#define archive_string_sprintf __archive_string_sprintf
/* Allocates a fresh buffer and converts as (assumed to be UTF-8) into it.