summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/c.mk2
-rw-r--r--parse/use.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/mk/c.mk b/mk/c.mk
index a98a5c2..1355014 100644
--- a/mk/c.mk
+++ b/mk/c.mk
@@ -6,7 +6,7 @@ _LIBSRCHPATHS=$(addprefix -L, $(dir $(DEPS)))
_LIBINCPATHS=$(addprefix -I, $(dir $(DEPS)))
_LIBPATHS=$(addprefix -l, $(patsubst lib%.a,%,$(notdir $(DEPS))))
-CFLAGS += -Wall -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers
+CFLAGS += -Wall -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wunreachable-code
CFLAGS += -g
CFLAGS += -MMD -MP -MF ${_DEPSDIR}/$(subst /,-,$*).d
diff --git a/parse/use.c b/parse/use.c
index 90279fe..4af5ea9 100644
--- a/parse/use.c
+++ b/parse/use.c
@@ -384,7 +384,7 @@ Trait *traitunpickle(FILE *fd)
n = rdint(fd);
for (i = 0; i < n; i++)
lappend(&tr->funcs, &tr->nfuncs, unpickle(fd));
- htput(trmap, (void*)i, traittab[i]);
+ htput(trmap, (void*)uid, tr);
return tr;
}
@@ -774,7 +774,8 @@ foundlib:
case 'R':
tr = traitunpickle(f);
puttrait(s, tr->name, tr);
- printf("installing trait %s\n", namestr(tr->name));
+ for (i = 0; i < tr->nfuncs; i++)
+ putdcl(s, tr->funcs[i]);
break;
case 'T':
tid = rdint(f);
@@ -892,6 +893,8 @@ void writeuse(FILE *f, Node *file)
k = htkeys(st->dcl, &n);
for (i = 0; i < n; i++) {
s = getdcl(st, k[i]);
+ if (s->decl.istraitfn)
+ continue;
if (s && s->decl.isgeneric)
wrbyte(f, 'G');
else