summaryrefslogtreecommitdiff
path: root/libarchive_fe
diff options
context:
space:
mode:
authorzoulasc <christos@zoulas.com>2020-01-21 13:34:18 -0500
committerMartin Matuska <martin@matuska.org>2020-01-23 00:19:32 +0100
commit343642bcd20450cacb534d6ea403a1ff6e420806 (patch)
tree1c2a6445898230483befa01f14b7554d82d287e5 /libarchive_fe
parent849740bac9788af44b0e2ae6403ee743b27b628f (diff)
downloadlibarchive-343642bcd20450cacb534d6ea403a1ff6e420806.tar.gz
Add printf attributes to the printflike functions used in tests and fix
the format errors. Closes #1318
Diffstat (limited to 'libarchive_fe')
-rw-r--r--libarchive_fe/err.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/libarchive_fe/err.h b/libarchive_fe/err.h
index ebf5de81..c663103b 100644
--- a/libarchive_fe/err.h
+++ b/libarchive_fe/err.h
@@ -35,9 +35,14 @@
#if defined(__GNUC__) && (__GNUC__ > 2 || \
(__GNUC__ == 2 && __GNUC_MINOR__ >= 7))
-#define __LA_PRINTFLIKE(f,a) __attribute__((__format__(__printf__, f, a)))
+# ifdef __MINGW_PRINTF_FORMAT
+# define __LA_PRINTF_FORMAT __MINGW_PRINTF_FORMAT
+# else
+# define __LA_PRINTF_FORMAT __printf__
+# endif
+# define __LA_PRINTFLIKE(f,a) __attribute__((__format__(__LA_PRINTF_FORMAT, f, a)))
#else
-#define __LA_PRINTFLIKE(f,a)
+# define __LA_PRINTFLIKE(f,a)
#endif
void lafe_warnc(int code, const char *fmt, ...) __LA_PRINTFLIKE(2, 3);