diff --git a/lang/cem/cemcom.ansi/ch3mon.c b/lang/cem/cemcom.ansi/ch3mon.c index 0148e006b..7a80b6d58 100644 --- a/lang/cem/cemcom.ansi/ch3mon.c +++ b/lang/cem/cemcom.ansi/ch3mon.c @@ -36,19 +36,14 @@ ch3mon(oper, expp) switch (oper) { case '*': /* 3.3.3.2 */ /* no FIELD type allowed */ - if ((*expp)->ex_type->tp_fund != POINTER) { - if ((*expp)->ex_type != error_type) { - expr_error(*expp, + expr = *expp; + if (expr->ex_type->tp_fund != POINTER) { + if (expr->ex_type != error_type) { + expr_error(expr, "* applied to non-pointer (%s)", - symbol2str((*expp)->ex_type->tp_fund)); + symbol2str(expr->ex_type->tp_fund)); } } else { - expr = *expp; - - if (expr->ex_type->tp_up->tp_fund != FUNCTION && - expr->ex_type->tp_up->tp_size <= 0) { - expr_error(expr, "incomplete type in expression"); - } if (is_ld_cst(expr)) /* dereference in administration only */ expr->ex_type = expr->ex_type->tp_up; @@ -60,6 +55,9 @@ ch3mon(oper, expp) expr->ex_type->tp_fund != ARRAY && expr->ex_type->tp_fund != FUNCTION ); + if (expr->ex_lvalue && expr->ex_type->tp_size <= 0) { + expr_error(expr, "incomplete type in expression"); + } if (expr->ex_type->tp_typequal & TQ_CONST) expr->ex_flags |= EX_READONLY; if (expr->ex_type->tp_typequal & TQ_VOLATILE) diff --git a/lang/cem/cemcom.ansi/proto.make b/lang/cem/cemcom.ansi/proto.make index 165444a69..2ac31ba80 100644 --- a/lang/cem/cemcom.ansi/proto.make +++ b/lang/cem/cemcom.ansi/proto.make @@ -165,8 +165,7 @@ dependencies: resolved do_deps `grep '.c$$' Cfiles` make.main: dependencies make_macros lists $(SRC_DIR)/proto.main - sed -e '/^#DEPENDENCIES/,$$d' -e '/^#PARAMS/r make_macros' -e '/^#LISTS/r lists' $(SRC_DIR)/proto.main > make.main - echo '#DEPENDENCIES' >> make.main + rm_deps $(SRC_DIR)/proto.main | sed -e '/^.PARAMS/r make_macros' -e '/^.LISTS/r lists' > make.main cat *.dep >> make.main make_macros: Makefile @@ -188,7 +187,7 @@ lists: Cfiles echo "C_SRC = \\" > lists echo $(CFILES) >> lists echo "OBJ = \\" >> lists - echo $(CFILES) | sed -e 's#[^ ]*/##g' -e 's/\.c/.$$(SUF)/g' >> lists + echo $(CFILES) | sed -e 's|[^ ]*/||g' -e 's/\.c/.$$(SUF)/g' >> lists clean: -make -f make.main clean