From 9053ebe6eeb2ae762655b982e27c341cb568366d Mon Sep 17 00:00:00 2001 From: Joel Carlson Date: Tue, 9 Oct 2018 15:40:46 -0600 Subject: [PATCH] compiler/str.h: include stdarg.h for va_list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With some toolchains, compilation of str.c produced the following error: compiler/str.h:56:50: error: unknown type name ‘va_list’ int str_vaddf(struct str *v, const char *format, va_list ap) ATTR(2,0); ^~~~~~~ One toolchain had the following in its stdarg.h: "We deliberately do not define va_list when called from stdio.h, because ANSI C says that stdio.h is not supposed to define va_list." str.c includes stdio.h, but none of the prior includes result in the inclusion of stdarg.h. Therefore, explicitly include it in str.h to fix the issue on toolchains following this ANSI C rule. Signed-off-by: Joel Carlson --- compiler/str.h | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/str.h b/compiler/str.h index 37a95a8..f2763c2 100644 --- a/compiler/str.h +++ b/compiler/str.h @@ -9,6 +9,7 @@ #include #include +#include struct str { char *str;