This PR adds support for variadic functions to exe backend. The portable libc already implemented the va_list/va_arg/va_end macros but used the comma operator which wasn't properly supported by pnut. This PR:
adds support , operator in both backends. Note that , is not part of the POSIX standard and is not portable, in particular, dash and yash don't support it.
adds parenthesized AST node to distinguish between f(a,b) and f((a,b)). This makes it possible to pass va_arg as the sole argument to a function.
Context
This PR adds support for variadic functions to exe backend. The portable libc already implemented the
va_list
/va_arg
/va_end
macros but used the comma operator which wasn't properly supported by pnut. This PR:,
operator in both backends. Note that,
is not part of the POSIX standard and is not portable, in particular, dash and yash don't support it.f(a,b)
andf((a,b))
. This makes it possible to passva_arg
as the sole argument to a function....