Commit 525cbc6e authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make error details conditional on there being details to show.

parent 4d3c70c7
......@@ -163,14 +163,16 @@ parse_new(struct vcc *tl)
VSB_printf(tl->sb, "Object name '%.*s' already used.\n",
PF(tl->t));
VSB_printf(tl->sb, "First usage:\n");
AN(sy1->def_b);
if (sy1->def_e != NULL)
vcc_ErrWhere2(tl, sy1->def_b, sy1->def_e);
else
vcc_ErrWhere(tl, sy1->def_b);
VSB_printf(tl->sb, "Redefinition:\n");
vcc_ErrWhere(tl, tl->t);
if (sy1->def_b) {
VSB_printf(tl->sb, "First usage:\n");
AN(sy1->def_b);
if (sy1->def_e != NULL)
vcc_ErrWhere2(tl, sy1->def_b, sy1->def_e);
else
vcc_ErrWhere(tl, sy1->def_b);
VSB_printf(tl->sb, "Redefinition:\n");
vcc_ErrWhere(tl, tl->t);
}
return;
}
......
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