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, ...@@ -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_ErrToken(const struct vcc *tl, const struct token *t);
void vcc_ErrWhere(struct vcc *, const struct token *); void vcc_ErrWhere(struct vcc *, const struct token *);
void vcc_ErrWhere2(struct vcc *, const struct token *, 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); void vcc__Expect(struct vcc *tl, unsigned tok, unsigned line);
int vcc_IdIs(const struct token *t, const char *p); 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, ...@@ -183,6 +183,16 @@ vcc_markline(const struct vcc *tl, const char *l, const char *le,
VSB_putc(tl->sb, '\n'); 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 */ /* XXX: should take first+last token */
......
...@@ -281,10 +281,9 @@ Emit_UDS_Path(struct vcc *tl, const struct token *t_path, const char *errid) ...@@ -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, VSB_printf(tl->sb, "%s: Cannot stat: %s\n", errid,
strerror(errno)); strerror(errno));
vcc_ErrWhere(tl, t_path); vcc_ErrWhere(tl, t_path);
if (err == ENOENT || err == EACCES) { if (err == ENOENT || err == EACCES)
VSB_cat(tl->sb, "(That was just a warning)\n"); vcc_Warn(tl);
tl->err = 0; else
} else
return; return;
} else if (!S_ISSOCK(st.st_mode)) { } else if (!S_ISSOCK(st.st_mode)) {
VSB_printf(tl->sb, "%s: Not a socket:\n", errid); VSB_printf(tl->sb, "%s: Not a socket:\n", errid);
......
...@@ -83,10 +83,8 @@ vcc_checkref(struct vcc *tl, const struct symbol *sym) ...@@ -83,10 +83,8 @@ vcc_checkref(struct vcc *tl, const struct symbol *sym)
VSB_printf(tl->sb, "Unused %s %.*s, defined:\n", VSB_printf(tl->sb, "Unused %s %.*s, defined:\n",
sym->kind->name, PF(sym->def_b)); sym->kind->name, PF(sym->def_b));
vcc_ErrWhere(tl, sym->def_b); vcc_ErrWhere(tl, sym->def_b);
if (!tl->err_unref) { if (!tl->err_unref)
VSB_cat(tl->sb, "(That was just a warning)\n"); vcc_Warn(tl);
tl->err = 0;
}
} }
} }
...@@ -233,10 +231,8 @@ vcc_checkaction2(struct vcc *tl, const struct symbol *sym) ...@@ -233,10 +231,8 @@ vcc_checkaction2(struct vcc *tl, const struct symbol *sym)
return; return;
VSB_cat(tl->sb, "Function unused\n"); VSB_cat(tl->sb, "Function unused\n");
vcc_ErrWhere(tl, p->name); vcc_ErrWhere(tl, p->name);
if (!tl->err_unref) { if (!tl->err_unref)
VSB_cat(tl->sb, "(That was just a warning)\n"); vcc_Warn(tl);
tl->err = 0;
}
} }
int 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