*.h: add a few missing __attribute__((format))

Add missing format attributes to API functions that take printf arguments. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Jul 13, 2021 at 10:05 UTC 75d31ceec5870c94c934264b7a9afe029b787410
3 files changed +3
cache.h
+1
@@ -1385,6 +1385,7 @@ enum get_oid_result {
1385 };
1386
1387 int repo_get_oid(struct repository *r, const char *str, struct object_id *oid);
1388 +__attribute__((format (printf, 2, 3)))
1389 int get_oidf(struct object_id *oid, const char *fmt, ...);
1390 int repo_get_oid_commit(struct repository *r, const char *str, struct object_id *oid);
1391 int repo_get_oid_committish(struct repository *r, const char *str, struct object_id *oid);
quote.h
+1
@@ -31,6 +31,7 @@ struct strbuf;
31
32 void sq_quote_buf(struct strbuf *, const char *src);
33 void sq_quote_argv(struct strbuf *, const char **argv);
34 +__attribute__((format (printf, 2, 3)))
35 void sq_quotef(struct strbuf *, const char *fmt, ...);
36
37 /*
strbuf.h
+1
@@ -263,6 +263,7 @@ static inline void strbuf_insertstr(struct strbuf *sb, size_t pos,
263 void strbuf_vinsertf(struct strbuf *sb, size_t pos, const char *fmt,
264 va_list ap);
265
266 +__attribute__((format (printf, 3, 4)))
267 void strbuf_insertf(struct strbuf *sb, size_t pos, const char *fmt, ...);
268
269 /**