From ba62ce0edcc804636407fd66cf7f912c5d10b419 Mon Sep 17 00:00:00 2001 From: ceriel Date: Fri, 15 Jan 1993 12:41:15 +0000 Subject: [PATCH] Added diagnostic about use of for example union tag as a struct tag --- lang/cem/cemcom.ansi/struct.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lang/cem/cemcom.ansi/struct.c b/lang/cem/cemcom.ansi/struct.c index 5c2083e5c..06a309493 100644 --- a/lang/cem/cemcom.ansi/struct.c +++ b/lang/cem/cemcom.ansi/struct.c @@ -248,8 +248,15 @@ apply_struct(fund, idf, tpp) tgp = &idf->id_tag; - if (*tgp) + if (*tgp) { + if (fund != (*tgp)->tg_type->tp_fund) { + error("tag %s indicates a %s, not a %s", + idf->id_text, + symbol2str((*tgp)->tg_type->tp_fund), + symbol2str(fund)); + } *tpp = (*tgp)->tg_type; + } else declare_struct(fund, idf, tpp); } -- 2.34.1