Example code:
struct s {int x;};
int f(int n, ...) {
struct s s;
__builtin_va_list ap;
__builtin_va_start(ap, n);
s = __builtin_va_arg(ap, struct s);
__builtin_va_end(ap);
return s.x;
}
int main(void) {
return f(1, (struct s){0});
}
Currently this crashes with a segfault on my system. QBE currently only allows base types for vaarg
, so for now, we should just error out.