Skip to content

Commit 89e78c7

Browse files
committed
__attribute__: trace2_region_enter_printf() is like "printf"
The last part of the parameter list the function takes is like parameters to printf. Mark it as such. An existing call that formats a value of type size_t using "%d" was found by the compiler with the help with this annotation; fix it. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 786a3e4 commit 89e78c7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

run-command.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,8 @@ void run_processes_parallel(const struct run_process_parallel_opts *opts)
17531753

17541754
if (do_trace2)
17551755
trace2_region_enter_printf(tr2_category, tr2_label, NULL,
1756-
"max:%d", opts->processes);
1756+
"max:%"PRIuMAX,
1757+
(uintmax_t)opts->processes);
17571758

17581759
pp_init(&pp, opts, &pp_sig);
17591760
while (1) {

trace2.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ void trace2_region_enter_printf_va_fl(const char *file, int line,
390390
trace2_region_enter_printf_va_fl(__FILE__, __LINE__, (category), \
391391
(label), (repo), (fmt), (ap))
392392

393+
__attribute__((format (printf, 6, 7)))
393394
void trace2_region_enter_printf_fl(const char *file, int line,
394395
const char *category, const char *label,
395396
const struct repository *repo,

0 commit comments

Comments
 (0)