aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/cc/cc.c
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2020-05-30 15:09:33 -0700
committerNicholas Noll <nbnoll@eml.cc>2020-05-30 15:09:33 -0700
commitcf65141f154651115028d6456a1d7582d30b2083 (patch)
tree731b1b1fe7e513e8e9410ad090687fa203838f43 /sys/cmd/cc/cc.c
parent038ea2d0a34fb362f577e6c9884c710ebaf4042e (diff)
many bug fixes
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){