Re: [PATCH] remote-http: use argv-array
- From
- Matt Kraai <kraai@ftbfs.org>
- Date
- Jul 9, 2013, 22:27 UTC
- Message-ID
- <loom.20130710T002441-147@post.gmane.org>
- In-Reply-To
- <20130709063840.GA8015@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> On Tue, Jul 09, 2013 at 08:05:19AM +0200, Bert Wesarg wrote: > > > + argv_array_pushl(&args, "send-pack", "--stateless-rpc",
"--helper-status");
Show 6 quoted lines
> > > > missing NULL sentinel. GCC has the 'sentinel' [1] attribute to catch > > such errors. Or use macro magic: > > > > void argv_array_pushl_(struct argv_array *array, ...); > > #define argv_array_pushl(array, ...) argv_array_pushl_(array,
__VA_ARGS__, NULL)
> > Nice catch. We cannot use variadic macros, because we support pre-C99 > compilers that do not have them. But the sentinel attribute is a good > idea. Here's a patch.
This attribute could also be used for builtin/revert.c:verify_opt_compatible, builtin/revert.c:verify_opt_mutually_compatible, exec_cmd.h:execl_git_cmd, and run-command.h:run_hook.
-- Matt