if (!sym->type) {
sym->type = copyLinkChain($1);
sym->etype = getSpec(sym->type);
- /* make sure the type is complete and sane */
- checkTypeSanity(sym->etype, sym->name);
}
else
addDecl (sym,0,cloneSpec($1));
+ /* make sure the type is complete and sane */
+ checkTypeSanity(sym->etype, sym->name);
}
$$ = $2;
}
/* if casting to/from pointers, do some checking */
if (IS_PTR(type)) { // to a pointer
- if (!IS_PTR(optype) && !IS_FUNC(optype)) { // from a non pointer
+ if (!IS_PTR(optype) && !IS_FUNC(optype) && !IS_AGGREGATE(optype)) { // from a non pointer
if (IS_INTEGRAL(optype)) {
// maybe this is NULL, than it's ok.
if (!(IS_LITERAL(optype) && (SPEC_CVAL(optype).v_ulong ==0))) {
"operand invalid for bitwise operation" },
{ E_ANDOR_OP, ERROR_LEVEL_ERROR,
"Invalid operand for '&&' or '||'" },
-{ E_TYPE_MISMATCH, ERROR_LEVEL_WARNING,
+{ E_TYPE_MISMATCH, ERROR_LEVEL_ERROR,
"indirections to different types %s %s " },
{ E_AGGR_ASSIGN, ERROR_LEVEL_ERROR,
"cannot assign values to aggregates" },