Commit Diff


commit - d089c3673c062bc918fd8fedb82b992855965ec6
commit + 756050ac401f1e724f0c1fd97af4a9855589c703
blob - 9dcd5b85b181ee63d76a75bf16c9ae0dc46aaa26
blob + 1d0c10d78dbadca30895a068e7909856805f6496
--- include/got_error.h
+++ include/got_error.h
@@ -265,7 +265,8 @@ const struct got_error *got_error_path(const char *, i
  * from the provided format string and the variable-length list of
  * additional arguments.
 */
-const struct got_error *got_error_fmt(int, const char *, ...);
+const struct got_error *got_error_fmt(int, const char *, ...)
+	__attribute__((__format__ (printf, 2, 3)));
 
 /*
  * Check whether open(2) with O_NOFOLLOW failed on a symlink.
blob - d401d4ed9c42375d81a4e41c59a8657a274eb281
blob + dbbf1df2ebec072333fd1aaef08fac6a2f818de9
--- lib/pack_create.c
+++ lib/pack_create.c
@@ -27,6 +27,7 @@
 #include <errno.h>
 #include <stdint.h>
 #include <imsg.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -1372,7 +1373,7 @@ recv_painted_commit(void *arg, struct got_object_id *i
 	default:
 		/* should not happen */
 		return got_error_fmt(GOT_ERR_NOT_IMPL,
-		    "%s invalid commit color %d", __func__, color);
+		    "%s invalid commit color %"PRIdPTR, __func__, color);
 	}
 
 	STAILQ_FOREACH_SAFE(qid, a->ids, entry, tmp) {
@@ -1616,7 +1617,8 @@ paint_commits(int *ncolored, struct got_object_id_queu
 		default:
 			/* should not happen */
 			err = got_error_fmt(GOT_ERR_NOT_IMPL,
-			    "%s invalid commit color %d", __func__, color);
+			    "%s invalid commit color %"PRIdPTR, __func__,
+			    color);
 			goto done;
 		}
 
blob - 30401fee605c3b7937f25d1f3c8f216c945c9525
blob + 1400f75cd82a62af84447ebaeee062b963f74f31
--- libexec/got-read-pack/got-read-pack.c
+++ libexec/got-read-pack/got-read-pack.c
@@ -21,6 +21,7 @@
 #include <sys/time.h>
 #include <sys/mman.h>
 
+#include <inttypes.h>
 #include <limits.h>
 #include <signal.h>
 #include <stdint.h>
@@ -1663,7 +1664,8 @@ paint_commits(struct got_object_id_queue *ids, int *ni
 		default:
 			/* should not happen */
 			err = got_error_fmt(GOT_ERR_NOT_IMPL,
-			    "%s invalid commit color %d", __func__, color);
+			    "%s invalid commit color %"PRIdPTR, __func__,
+			    color);
 			goto done;
 		}