Skip to content

Commit 7e93684

Browse files
peffgitster
authored andcommitted
pkt-line: annotate packet_writel with LAST_ARG_MUST_BE_NULL
packet_writel() takes a variable-sized list and reads to the first NULL. Let's let the compiler know so that it can help us catch mistakes in the callers. This should have been annotated similarly when it was a static function, but it's doubly important now that the function is available to the whole code-base. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent c0c70f7 commit 7e93684

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

pkt-line.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ void packet_buf_flush(struct strbuf *buf);
2525
void packet_buf_write(struct strbuf *buf, const char *fmt, ...) __attribute__((format (printf, 2, 3)));
2626
int packet_flush_gently(int fd);
2727
int packet_write_fmt_gently(int fd, const char *fmt, ...) __attribute__((format (printf, 2, 3)));
28+
LAST_ARG_MUST_BE_NULL
2829
int packet_writel(int fd, const char *line, ...);
2930
int write_packetized_from_fd(int fd_in, int fd_out);
3031
int write_packetized_from_buf(const char *src_in, size_t len, int fd_out);

0 commit comments

Comments
 (0)