Extension: Automatic Varargs

Example

int
print(char *fmt, ...)
{
  vprint(fmt, ...);
}

Syntax & Semantics

The extension defines ... as a valid expression within a variadic function body. Each use compiles into a new va_arg with appropriate va_start and va_end lines inserted.

Implementation

Not implemented.

Implemented in earlier rscc, without va_end.

Extend compile: check for ..., create the va_list variable, emit the va_start onto the compiled code list, and return the va_list variable as the compiled form. The hard part is inserting the va_end -- there are no hooks at the moment.