overflow(expp)
t_node *expp;
{
- node_warning(expp, W_ORDINARY, "overflow in constant expression");
+ if (expp->nd_type != address_type) {
+ node_warning(expp, W_ORDINARY, "overflow in constant expression");
+ }
+}
+
+underflow(expp)
+ t_node *expp;
+{
+ if (expp->nd_type != address_type) {
+ node_warning(expp, W_ORDINARY, "underflow in constant expression");
+ }
}
STATIC
if (expp->nd_type->tp_fund == T_INTORCARD) {
expp->nd_type = int_type;
if (! chk_bounds(min_int[sz], o1 - o2, T_CARDINAL)) {
- overflow(expp);
+ underflow(expp);
}
}
- else overflow(expp);
+ else underflow(expp);
}
o1 -= o2;
break;
{ EnterParamList(ppr, FPList, tp, VARp, parmaddr); }
;
-FormalType(t_type **ptp;)
-{
- extern arith ArrayElSize();
-} :
+FormalType(t_type **ptp;) :
ARRAY OF qualtype(ptp)
{ /* index type of conformant array is "CARDINAL".
Recognize a conformant array by size 0.
tp->arr_elem = *ptp;
*ptp = tp;
- tp->arr_elsize = ArrayElSize(tp->arr_elem);
- tp->tp_align = tp->arr_elem->tp_align;
+ ArrayElSize(tp);
}
|
- qualtype(ptp)
+ qualtype(ptp)
;
TypeDeclaration
warning(W_ORDINARY, "empty record declaration");
size = 1;
}
- *ptp = standard_type(T_RECORD, xalign, size);
+ *ptp = standard_type(T_RECORD, xalign, align(size, xalign));
(*ptp)->rec_scope = scope;
}
END
}:
ConstExpression(pnd)
{
- if (*ptp != 0) {
- ChkCompat(pnd, *ptp, "case label");
+ if (*ptp != 0 && ChkCompat(pnd, *ptp, "case label")) {
}
nd = *pnd;
if (! (nd->nd_type->tp_fund & T_DISCRETE) ||