From 75d31ceec5870c94c934264b7a9afe029b787410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 13 Jul 2021 10:05:19 +0200 Subject: [PATCH] *.h: add a few missing __attribute__((format)) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing format attributes to API functions that take printf arguments. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- cache.h | 1 + quote.h | 1 + strbuf.h | 1 + 3 files changed, 3 insertions(+) diff --git a/cache.h b/cache.h index ba04ff8bd36..f9aed2d45c7 100644 --- a/cache.h +++ b/cache.h @@ -1385,6 +1385,7 @@ enum get_oid_result { }; int repo_get_oid(struct repository *r, const char *str, struct object_id *oid); +__attribute__((format (printf, 2, 3))) int get_oidf(struct object_id *oid, const char *fmt, ...); int repo_get_oid_commit(struct repository *r, const char *str, struct object_id *oid); int repo_get_oid_committish(struct repository *r, const char *str, struct object_id *oid); diff --git a/quote.h b/quote.h index 768cc6338e2..049d8dd0b3d 100644 --- a/quote.h +++ b/quote.h @@ -31,6 +31,7 @@ struct strbuf; void sq_quote_buf(struct strbuf *, const char *src); void sq_quote_argv(struct strbuf *, const char **argv); +__attribute__((format (printf, 2, 3))) void sq_quotef(struct strbuf *, const char *fmt, ...); /* diff --git a/strbuf.h b/strbuf.h index 223ee2094af..f1e9821a540 100644 --- a/strbuf.h +++ b/strbuf.h @@ -263,6 +263,7 @@ static inline void strbuf_insertstr(struct strbuf *sb, size_t pos, void strbuf_vinsertf(struct strbuf *sb, size_t pos, const char *fmt, va_list ap); +__attribute__((format (printf, 3, 4))) void strbuf_insertf(struct strbuf *sb, size_t pos, const char *fmt, ...); /**