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