summaryrefslogtreecommitdiff
path: root/libarchive_fe/err.h
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2012-07-27 08:24:12 +0000
committerMartin Matuska <mm@FreeBSD.org>2012-07-27 08:24:12 +0000
commit81418b36c02b6434acd4b8ae4cfb8c80a3742fd4 (patch)
tree4b551422581ae9a8093415e07c619e2a59ef6a7b /libarchive_fe/err.h
parent132160f77407d2174d2bec0a8ba9c6eefc4429d7 (diff)
Diffstat (limited to 'libarchive_fe/err.h')
-rw-r--r--libarchive_fe/err.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/libarchive_fe/err.h b/libarchive_fe/err.h
index dd79448139166..ca1af35630e25 100644
--- a/libarchive_fe/err.h
+++ b/libarchive_fe/err.h
@@ -33,9 +33,17 @@
#define __LA_DEAD
#endif
+#if defined(__GNUC__) && (__GNUC__ > 2 || \
+ (__GNUC__ == 2 && __GNUC_MINOR__ >= 7))
+#define __LA_PRINTFLIKE(f,a) __attribute__((__format__(__printf__, f, a)))
+#else
+#define __LA_PRINTFLIKE(f,a)
+#endif
+
extern const char *lafe_progname;
-void lafe_warnc(int code, const char *fmt, ...);
-void lafe_errc(int eval, int code, const char *fmt, ...) __LA_DEAD;
+void lafe_warnc(int code, const char *fmt, ...) __LA_PRINTFLIKE(2, 3);
+void lafe_errc(int eval, int code, const char *fmt, ...) __LA_DEAD
+ __LA_PRINTFLIKE(3, 4);
#endif