~mcf/cc-issues#52:
va_arg with struct/union type

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.

Status
REPORTED
Submitter
~mcf
Assigned to
No-one
Submitted
7 months ago
Updated
7 months ago
Labels
qbe