From: ceriel Date: Fri, 15 Jan 1993 12:41:15 +0000 (+0000) Subject: Added diagnostic about use of for example union tag as a struct tag X-Git-Tag: release-5-5~360 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=ba62ce0edcc804636407fd66cf7f912c5d10b419;p=ack.git Added diagnostic about use of for example union tag as a struct tag --- 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); }