some very minor changes
This commit is contained in:
parent
c3d4d40d1b
commit
66c247ba9c
|
@ -141,24 +141,27 @@ any2arith(expp, oper)
|
||||||
case LONG:
|
case LONG:
|
||||||
break;
|
break;
|
||||||
case ENUM:
|
case ENUM:
|
||||||
|
/* test the admissibility of the operator */
|
||||||
if ( is_test_op(oper) || oper == '=' || oper == PARCOMMA ||
|
if ( is_test_op(oper) || oper == '=' || oper == PARCOMMA ||
|
||||||
oper == ',' || oper == ':' ||
|
oper == ',' || oper == ':'
|
||||||
( !options['R'] &&
|
) {
|
||||||
(is_arith_op(oper) || is_asgn_op(oper))
|
/* allowed by K & R */
|
||||||
)
|
}
|
||||||
)
|
else
|
||||||
{}
|
if (!options['R']) {
|
||||||
|
/* allowed by us */
|
||||||
|
}
|
||||||
else
|
else
|
||||||
expr_warning(*expp, "%s on enum", symbol2str(oper));
|
expr_warning(*expp, "%s on enum", symbol2str(oper));
|
||||||
int2int(expp, int_type);
|
int2int(expp, int_type);
|
||||||
break;
|
break;
|
||||||
#ifndef NOFLOAT
|
#ifndef NOFLOAT
|
||||||
case FLOAT:
|
case FLOAT:
|
||||||
float2float(expp, double_type);
|
float2float(expp, double_type);
|
||||||
break;
|
break;
|
||||||
case DOUBLE:
|
case DOUBLE:
|
||||||
break;
|
break;
|
||||||
#endif NOFLOAT
|
#endif NOFLOAT
|
||||||
#ifndef NOBITFIELD
|
#ifndef NOBITFIELD
|
||||||
case FIELD:
|
case FIELD:
|
||||||
field2arith(expp);
|
field2arith(expp);
|
||||||
|
|
|
@ -208,7 +208,7 @@ arrayer(arith *sizep;)
|
||||||
[
|
[
|
||||||
constant_expression(&expr)
|
constant_expression(&expr)
|
||||||
{
|
{
|
||||||
array_subscript(expr);
|
check_array_subscript(expr);
|
||||||
*sizep = expr->VL_VALUE;
|
*sizep = expr->VL_VALUE;
|
||||||
free_expression(expr);
|
free_expression(expr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ reject_params(dc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
array_subscript(expr)
|
check_array_subscript(expr)
|
||||||
register struct expr *expr;
|
register struct expr *expr;
|
||||||
{
|
{
|
||||||
arith size = expr->VL_VALUE;
|
arith size = expr->VL_VALUE;
|
||||||
|
@ -104,7 +104,7 @@ array_subscript(expr)
|
||||||
expr->VL_VALUE = (arith)-1;
|
expr->VL_VALUE = (arith)-1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (size & ~max_unsigned) { /* absolute ridiculous */
|
if (size & ~max_unsigned) { /* absolutely ridiculous */
|
||||||
expr_error(expr, "overflow in array size");
|
expr_error(expr, "overflow in array size");
|
||||||
expr->VL_VALUE = (arith)1;
|
expr->VL_VALUE = (arith)1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue