diff options
| author | 2025-10-23 17:48:22 +0200 | |
|---|---|---|
| committer | 2025-10-23 17:49:47 +0200 | |
| commit | d5f154ed760d0929530fdce5409d5772a708ea05 (patch) | |
| tree | bc5b9742cda8016173ab539813f48e522ef264b1 /c | |
| parent | 1182280d291467f21052050ae9131810f8889635 (diff) | |
c: make builtin va_list an opaque struct
Diffstat (limited to 'c')
| -rw-r--r-- | c/c.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -3995,11 +3995,19 @@ function(struct comp *cm, struct function *fn, const char **pnames, const struct void docomp(struct comp *cm) { + static union type valistty; struct token tk[1]; if (!cm->env) cm->env = &toplevel; - putdecl(cm, &(struct decl) { mktype(TYVALIST), SCTYPEDEF, .name = intern("__builtin_va_list") }); + if (!valistty.t) { + struct typedata td = { + .t = TYSTRUCT, .siz = targ_valistsize, .align = targ_primalign[TYPTR], .nmemb = 1, + .fld = (struct namedfield [1]){{"?"}} + }; + valistty = mktagtype(intern("__builtin_va_list"), &td); + } + putdecl(cm, &(struct decl) { valistty, SCTYPEDEF, .name = intern("__builtin_va_list") }); while (peek(cm, tk) != TKEOF) { struct declstate st = { DTOPLEVEL }; |