Commit db83e59a authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

That was just a warning

parent 7ae1bf24
......@@ -374,6 +374,7 @@ void vcc_Coord(const struct vcc *tl, struct vsb *vsb,
void vcc_ErrToken(const struct vcc *tl, const struct token *t);
void vcc_ErrWhere(struct vcc *, const struct token *);
void vcc_ErrWhere2(struct vcc *, const struct token *, const struct token *);
void vcc_Warn(struct vcc *);
void vcc__Expect(struct vcc *tl, unsigned tok, unsigned line);
int vcc_IdIs(const struct token *t, const char *p);
......
......@@ -183,6 +183,16 @@ vcc_markline(const struct vcc *tl, const char *l, const char *le,
VSB_putc(tl->sb, '\n');
}
void
vcc_Warn(struct vcc *tl)
{
AN(tl);
AN(tl->err);
VSB_cat(tl->sb, "(That was just a warning)\n");
tl->err = 0;
}
/*--------------------------------------------------------------------*/
/* XXX: should take first+last token */
......
......@@ -281,10 +281,9 @@ Emit_UDS_Path(struct vcc *tl, const struct token *t_path, const char *errid)
VSB_printf(tl->sb, "%s: Cannot stat: %s\n", errid,
strerror(errno));
vcc_ErrWhere(tl, t_path);
if (err == ENOENT || err == EACCES) {
VSB_cat(tl->sb, "(That was just a warning)\n");
tl->err = 0;
} else
if (err == ENOENT || err == EACCES)
vcc_Warn(tl);
else
return;
} else if (!S_ISSOCK(st.st_mode)) {
VSB_printf(tl->sb, "%s: Not a socket:\n", errid);
......
......@@ -83,10 +83,8 @@ vcc_checkref(struct vcc *tl, const struct symbol *sym)
VSB_printf(tl->sb, "Unused %s %.*s, defined:\n",
sym->kind->name, PF(sym->def_b));
vcc_ErrWhere(tl, sym->def_b);
if (!tl->err_unref) {
VSB_cat(tl->sb, "(That was just a warning)\n");
tl->err = 0;
}
if (!tl->err_unref)
vcc_Warn(tl);
}
}
......@@ -233,10 +231,8 @@ vcc_checkaction2(struct vcc *tl, const struct symbol *sym)
return;
VSB_cat(tl->sb, "Function unused\n");
vcc_ErrWhere(tl, p->name);
if (!tl->err_unref) {
VSB_cat(tl->sb, "(That was just a warning)\n");
tl->err = 0;
}
if (!tl->err_unref)
vcc_Warn(tl);
}
int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment