use "sentinel" function attribute for variadic lists
This attribute can help gcc notice when callers forget to add a NULL sentinel to the end of the function. This is our first use of the sentinel attribute, but we shouldn't need to #ifdef for other compilers, as __attribute__ is already a no-op on non-gcc-compatible compilers. Suggested-by: Bert Wesarg <bert.wesarg@googlemail.com> More-Spots-Found-By: Matt Kraai <kraai@ftbfs.org> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
4621085b7e
commit
eccb614924
@ -46,6 +46,7 @@ int finish_command(struct child_process *);
|
||||
int run_command(struct child_process *);
|
||||
|
||||
extern char *find_hook(const char *name);
|
||||
__attribute__((sentinel))
|
||||
extern int run_hook(const char *index_file, const char *name, ...);
|
||||
|
||||
#define RUN_COMMAND_NO_STDIN 1
|
||||
|
Reference in New Issue
Block a user