summaryrefslogtreecommitdiffstats
path: root/scalar.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-06-18 00:55:55 +0200
committerJunio C Hamano <gitster@pobox.com>2024-06-18 00:55:55 +0200
commitcff3b034d5e75c84725823290afed62c93bc2317 (patch)
tree6a4ca6ecc757d40a079bc25d5094a68cb4c6c406 /scalar.c
parentMerge branch 'ps/ref-storage-migration' (diff)
parent__attribute__: add a few missing format attributes (diff)
downloadgit-cff3b034d5e75c84725823290afed62c93bc2317.tar.xz
git-cff3b034d5e75c84725823290afed62c93bc2317.zip
Merge branch 'jc/varargs-attributes'
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"
Diffstat (limited to 'scalar.c')
-rw-r--r--scalar.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/scalar.c b/scalar.c
index 331b91dbdb..a8318078c9 100644
--- a/scalar.c
+++ b/scalar.c
@@ -70,6 +70,7 @@ static void setup_enlistment_directory(int argc, const char **argv,
strbuf_release(&path);
}
+LAST_ARG_MUST_BE_NULL
static int run_git(const char *arg, ...)
{
struct child_process cmd = CHILD_PROCESS_INIT;
@@ -288,6 +289,7 @@ static int unregister_dir(void)
}
/* printf-style interface, expects `<key>=<value>` argument */
+__attribute__((format (printf, 1, 2)))
static int set_config(const char *fmt, ...)
{
struct strbuf buf = STRBUF_INIT;