From: ceriel Date: Thu, 15 Jun 1989 19:06:56 +0000 (+0000) Subject: fixed problem with void returns and changed a warning somewhat X-Git-Tag: release-5-5~2389 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=b1c3d1bc533a065b2b6d4eec52ca646a68bb3de9;p=ack.git fixed problem with void returns and changed a warning somewhat --- diff --git a/lang/cem/cemcom/arith.c b/lang/cem/cemcom/arith.c index 234cc5d58..19a9a9fa2 100644 --- a/lang/cem/cemcom/arith.c +++ b/lang/cem/cemcom/arith.c @@ -112,15 +112,17 @@ ch76pointer(expp, oper, tp) ch7cast(expp, oper, tp); } else - if ( is_integral_type(exp->ex_type) -#ifndef NOROPTION - && - ( !options['R'] /* we don't care */ || - (oper == EQUAL || oper == NOTEQUAL || oper == ':') - ) -#endif NOROPTION - ) /* ch 7.7 */ + if (is_integral_type(exp->ex_type)) { + if ( (oper != EQUAL && oper != NOTEQUAL && oper != ':') || + (!is_cp_cst(exp) || exp->VL_VALUE != 0) + ) { /* ch 7.6, ch 7.7 */ + expr_warning(exp, "%s on %s and pointer", + symbol2str(oper), + symbol2str(exp->ex_type->tp_fund) + ); + } ch7cast(expp, CAST, tp); + } else { expr_error(exp, "%s on %s and pointer", symbol2str(oper), diff --git a/lang/cem/cemcom/eval.c b/lang/cem/cemcom/eval.c index b4f6d86f5..352d10a49 100644 --- a/lang/cem/cemcom/eval.c +++ b/lang/cem/cemcom/eval.c @@ -69,7 +69,7 @@ EVAL(expr, val, code, true_label, false_label) int val, code; label true_label, false_label; { - register int gencode = (code == TRUE); + register int gencode = (code == TRUE && expr->ex_type->tp_size > 0); switch (expr->ex_class) { case Value: /* just a simple value */