Git fork

Merge branch 'jc/varargs-attributes' into maint-2.45

Varargs functions that are unannotated as printf-like or execl-like
have been annotated as such.

* jc/varargs-attributes:
__attribute__: add a few missing format attributes
__attribute__: mark some functions with LAST_ARG_MUST_BE_NULL
__attribute__: remove redundant attribute declaration for git_die_config()
__attribute__: trace2_region_enter_printf() is like "printf"

+11 -2
+1
add-patch.c
··· 300 300 va_end(args); 301 301 } 302 302 303 + LAST_ARG_MUST_BE_NULL 303 304 static void setup_child_process(struct add_p_state *s, 304 305 struct child_process *cp, ...) 305 306 {
+2
attr.h
··· 190 190 }; 191 191 192 192 struct attr_check *attr_check_alloc(void); 193 + 194 + LAST_ARG_MUST_BE_NULL 193 195 struct attr_check *attr_check_initl(const char *, ...); 194 196 struct attr_check *attr_check_dup(const struct attr_check *check); 195 197
-1
config.c
··· 2822 2822 key, filename, linenr); 2823 2823 } 2824 2824 2825 - NORETURN __attribute__((format(printf, 2, 3))) 2826 2825 void git_die_config(const char *key, const char *err, ...) 2827 2826 { 2828 2827 const struct string_list *values;
+1
hook.h
··· 86 86 * argument. These things will be used as positional arguments to the 87 87 * hook. This function behaves like the old run_hook_le() API. 88 88 */ 89 + LAST_ARG_MUST_BE_NULL 89 90 int run_hooks_l(const char *hook_name, ...); 90 91 #endif
+1
mem-pool.h
··· 50 50 /* 51 51 * Allocate memory from the memory pool and format a string into it. 52 52 */ 53 + __attribute__((format (printf, 2, 3))) 53 54 char *mem_pool_strfmt(struct mem_pool *pool, const char *fmt, ...); 54 55 55 56 /*
+2 -1
run-command.c
··· 1753 1753 1754 1754 if (do_trace2) 1755 1755 trace2_region_enter_printf(tr2_category, tr2_label, NULL, 1756 - "max:%d", opts->processes); 1756 + "max:%"PRIuMAX, 1757 + (uintmax_t)opts->processes); 1757 1758 1758 1759 pp_init(&pp, opts, &pp_sig); 1759 1760 while (1) {
+2
scalar.c
··· 70 70 strbuf_release(&path); 71 71 } 72 72 73 + LAST_ARG_MUST_BE_NULL 73 74 static int run_git(const char *arg, ...) 74 75 { 75 76 struct child_process cmd = CHILD_PROCESS_INIT; ··· 288 289 } 289 290 290 291 /* printf-style interface, expects `<key>=<value>` argument */ 292 + __attribute__((format (printf, 1, 2))) 291 293 static int set_config(const char *fmt, ...) 292 294 { 293 295 struct strbuf buf = STRBUF_INIT;
+1
trace2.h
··· 390 390 trace2_region_enter_printf_va_fl(__FILE__, __LINE__, (category), \ 391 391 (label), (repo), (fmt), (ap)) 392 392 393 + __attribute__((format (printf, 6, 7))) 393 394 void trace2_region_enter_printf_fl(const char *file, int line, 394 395 const char *category, const char *label, 395 396 const struct repository *repo,
+1
wt-status.c
··· 126 126 va_end(ap); 127 127 } 128 128 129 + __attribute__((format (printf, 3, 4))) 129 130 static void status_printf_more(struct wt_status *s, const char *color, 130 131 const char *fmt, ...) 131 132 {