fixed problem with void returns and changed a warning somewhat

This commit is contained in:
ceriel 1989-06-15 19:06:56 +00:00
parent 56e985729d
commit b1c3d1bc53
2 changed files with 11 additions and 9 deletions

View file

@ -112,15 +112,17 @@ ch76pointer(expp, oper, tp)
ch7cast(expp, oper, tp); ch7cast(expp, oper, tp);
} }
else else
if ( is_integral_type(exp->ex_type) if (is_integral_type(exp->ex_type)) {
#ifndef NOROPTION if ( (oper != EQUAL && oper != NOTEQUAL && oper != ':') ||
&& (!is_cp_cst(exp) || exp->VL_VALUE != 0)
( !options['R'] /* we don't care */ || ) { /* ch 7.6, ch 7.7 */
(oper == EQUAL || oper == NOTEQUAL || oper == ':') expr_warning(exp, "%s on %s and pointer",
) symbol2str(oper),
#endif NOROPTION symbol2str(exp->ex_type->tp_fund)
) /* ch 7.7 */ );
}
ch7cast(expp, CAST, tp); ch7cast(expp, CAST, tp);
}
else { else {
expr_error(exp, "%s on %s and pointer", expr_error(exp, "%s on %s and pointer",
symbol2str(oper), symbol2str(oper),

View file

@ -69,7 +69,7 @@ EVAL(expr, val, code, true_label, false_label)
int val, code; int val, code;
label true_label, false_label; 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) { switch (expr->ex_class) {
case Value: /* just a simple value */ case Value: /* just a simple value */