aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/cc/cc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cmd/cc/cc.c')
-rw-r--r--sys/cmd/cc/cc.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/cmd/cc/cc.c b/sys/cmd/cc/cc.c
index 796d3a8..24bc9e0 100644
--- a/sys/cmd/cc/cc.c
+++ b/sys/cmd/cc/cc.c
@@ -215,6 +215,28 @@ init(void)
C.type.info = calloc(C.type.cap, sizeof(*C.type.info));
memcpy(C.type.info, basetypes, C.type.len * sizeof(*C.type.info));
+
+ /* builtins */
+ C.builtin.vargs = (Decl) {
+ .pos = (Range) {
+ .beg = {
+ .col = 0,
+ .line = 0,
+ .path = "<builtin>",
+ },
+ .end = {
+ .col = 0,
+ .line = 0,
+ .path = "<builtin>",
+ },
+ },
+ .kind = Dtype,
+ .spec = Mtype,
+ .type = 1,
+ .name = "__builtin_va_list",
+ };
+
+ intern(&C.builtin.vargs.name);
}
void
@@ -287,8 +309,8 @@ compile(byte *path)
}
}
- initp(&p);
initlx(&lx);
+ initp(&p);
lx.io = openio(&lx, path);
lx.pos = (Pos){