From 7e936842f54c98eb41fb46c94da417065fe333f5 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sat, 13 May 2017 05:04:58 -0400 Subject: 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 Signed-off-by: Junio C Hamano --- pkt-line.h | 1 + 1 file changed, 1 insertion(+) diff --git a/pkt-line.h b/pkt-line.h index b2965869ad..450183b649 100644 --- a/pkt-line.h +++ b/pkt-line.h @@ -25,6 +25,7 @@ void packet_buf_flush(struct strbuf *buf); void packet_buf_write(struct strbuf *buf, const char *fmt, ...) __attribute__((format (printf, 2, 3))); int packet_flush_gently(int fd); int packet_write_fmt_gently(int fd, const char *fmt, ...) __attribute__((format (printf, 2, 3))); +LAST_ARG_MUST_BE_NULL int packet_writel(int fd, const char *line, ...); int write_packetized_from_fd(int fd_in, int fd_out); int write_packetized_from_buf(const char *src_in, size_t len, int fd_out); -- cgit v1.2.3