]> git.ipfire.org Git - thirdparty/git.git/commitdiff
*.h: add a few missing __attribute__((format))
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 13 Jul 2021 08:05:19 +0000 (10:05 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Jul 2021 22:20:20 +0000 (15:20 -0700)
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>
cache.h
quote.h
strbuf.h

diff --git a/cache.h b/cache.h
index ba04ff8bd36b3627c95fc7b9b3fc2aec2d55c205..f9aed2d45c75084a00a79df82bcd6f2bebefaf97 100644 (file)
--- 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 768cc6338e27d73c8a10cf5eae76ad5626c73e3e..049d8dd0b3d7e42547ef42b460dcaaf95a412a68 100644 (file)
--- 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, ...);
 
 /*
index 223ee2094af87868b510fb015baa52720d3cf923..f1e9821a54003ee300d6703d50830622dac2eeb7 100644 (file)
--- 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, ...);
 
 /**