Skip to content

Commit 75d31ce

Browse files
avargitster
authored andcommitted
*.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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 48ca53c commit 75d31ce

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

cache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,6 +1385,7 @@ enum get_oid_result {
13851385
};
13861386

13871387
int repo_get_oid(struct repository *r, const char *str, struct object_id *oid);
1388+
__attribute__((format (printf, 2, 3)))
13881389
int get_oidf(struct object_id *oid, const char *fmt, ...);
13891390
int repo_get_oid_commit(struct repository *r, const char *str, struct object_id *oid);
13901391
int repo_get_oid_committish(struct repository *r, const char *str, struct object_id *oid);

quote.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ struct strbuf;
3131

3232
void sq_quote_buf(struct strbuf *, const char *src);
3333
void sq_quote_argv(struct strbuf *, const char **argv);
34+
__attribute__((format (printf, 2, 3)))
3435
void sq_quotef(struct strbuf *, const char *fmt, ...);
3536

3637
/*

strbuf.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ static inline void strbuf_insertstr(struct strbuf *sb, size_t pos,
263263
void strbuf_vinsertf(struct strbuf *sb, size_t pos, const char *fmt,
264264
va_list ap);
265265

266+
__attribute__((format (printf, 3, 4)))
266267
void strbuf_insertf(struct strbuf *sb, size_t pos, const char *fmt, ...);
267268

268269
/**

0 commit comments

Comments
 (0)