Skip to content

Commit ba74464

Browse files
committed
__attribute__: mark some functions with LAST_ARG_MUST_BE_NULL
Some varargs functions that use NULL-terminated parameter list were missing __attributes__ ((sentinel)) aka LAST_ARG_MUST_BE_NULL. Add them. Signed-off-by: Junio C Hamano <[email protected]>
1 parent f52c9a2 commit ba74464

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

add-patch.c

+1
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ static void err(struct add_p_state *s, const char *fmt, ...)
300300
va_end(args);
301301
}
302302

303+
LAST_ARG_MUST_BE_NULL
303304
static void setup_child_process(struct add_p_state *s,
304305
struct child_process *cp, ...)
305306
{

attr.h

+2
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ struct attr_check {
190190
};
191191

192192
struct attr_check *attr_check_alloc(void);
193+
194+
LAST_ARG_MUST_BE_NULL
193195
struct attr_check *attr_check_initl(const char *, ...);
194196
struct attr_check *attr_check_dup(const struct attr_check *check);
195197

hook.h

+1
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,6 @@ int run_hooks(const char *hook_name);
8686
* argument. These things will be used as positional arguments to the
8787
* hook. This function behaves like the old run_hook_le() API.
8888
*/
89+
LAST_ARG_MUST_BE_NULL
8990
int run_hooks_l(const char *hook_name, ...);
9091
#endif

scalar.c

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ static void setup_enlistment_directory(int argc, const char **argv,
7070
strbuf_release(&path);
7171
}
7272

73+
LAST_ARG_MUST_BE_NULL
7374
static int run_git(const char *arg, ...)
7475
{
7576
struct child_process cmd = CHILD_PROCESS_INIT;

0 commit comments

Comments
 (0)