shithub: jbig2

Download patch

ref: 15cde40a951c60442f70098662fec277a4c152f9
parent: 7d76ed65a8e97caa596537b949d17458357db6d4
author: Julian Smith <jules@op59.net>
date: Thu Nov 21 11:49:51 EST 2019

If gcc, make gcc check jbig2_error()'s format string agrees with types of parameters.

--- a/jbig2_priv.h
+++ b/jbig2_priv.h
@@ -116,7 +116,11 @@
 
 #define jbig2_renew(ctx, p, t, size) ((t *)jbig2_realloc(ctx->allocator, (p), size, sizeof(t)))
 
-int jbig2_error(Jbig2Ctx *ctx, Jbig2Severity severity, int32_t seg_idx, const char *fmt, ...);
+int jbig2_error(Jbig2Ctx *ctx, Jbig2Severity severity, int32_t seg_idx, const char *fmt, ...)
+#ifdef __GNUC__
+    __attribute__ ((format (__printf__, 4, 5)))
+#endif
+    ;
 
 /* The word stream design is a compromise between simplicity and
    trying to amortize the number of method calls. Each ::get_next_word