too many changes: some cosmetic; some for 2/4; some for added options
This commit is contained in:
parent
bb51d7b0e2
commit
0976dfa3b9
2 changed files with 18 additions and 13 deletions
|
@ -38,7 +38,17 @@ extern char options[];
|
||||||
overflow(expp)
|
overflow(expp)
|
||||||
t_node *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
|
STATIC
|
||||||
|
@ -295,10 +305,10 @@ cstubin(expp)
|
||||||
if (expp->nd_type->tp_fund == T_INTORCARD) {
|
if (expp->nd_type->tp_fund == T_INTORCARD) {
|
||||||
expp->nd_type = int_type;
|
expp->nd_type = int_type;
|
||||||
if (! chk_bounds(min_int[sz], o1 - o2, T_CARDINAL)) {
|
if (! chk_bounds(min_int[sz], o1 - o2, T_CARDINAL)) {
|
||||||
overflow(expp);
|
underflow(expp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else overflow(expp);
|
else underflow(expp);
|
||||||
}
|
}
|
||||||
o1 -= o2;
|
o1 -= o2;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -150,10 +150,7 @@ FPSection(t_param **ppr; arith *parmaddr;)
|
||||||
{ EnterParamList(ppr, FPList, tp, VARp, parmaddr); }
|
{ EnterParamList(ppr, FPList, tp, VARp, parmaddr); }
|
||||||
;
|
;
|
||||||
|
|
||||||
FormalType(t_type **ptp;)
|
FormalType(t_type **ptp;) :
|
||||||
{
|
|
||||||
extern arith ArrayElSize();
|
|
||||||
} :
|
|
||||||
ARRAY OF qualtype(ptp)
|
ARRAY OF qualtype(ptp)
|
||||||
{ /* index type of conformant array is "CARDINAL".
|
{ /* index type of conformant array is "CARDINAL".
|
||||||
Recognize a conformant array by size 0.
|
Recognize a conformant array by size 0.
|
||||||
|
@ -162,11 +159,10 @@ FormalType(t_type **ptp;)
|
||||||
|
|
||||||
tp->arr_elem = *ptp;
|
tp->arr_elem = *ptp;
|
||||||
*ptp = tp;
|
*ptp = tp;
|
||||||
tp->arr_elsize = ArrayElSize(tp->arr_elem);
|
ArrayElSize(tp);
|
||||||
tp->tp_align = tp->arr_elem->tp_align;
|
|
||||||
}
|
}
|
||||||
|
|
|
|
||||||
qualtype(ptp)
|
qualtype(ptp)
|
||||||
;
|
;
|
||||||
|
|
||||||
TypeDeclaration
|
TypeDeclaration
|
||||||
|
@ -289,7 +285,7 @@ RecordType(t_type **ptp;)
|
||||||
warning(W_ORDINARY, "empty record declaration");
|
warning(W_ORDINARY, "empty record declaration");
|
||||||
size = 1;
|
size = 1;
|
||||||
}
|
}
|
||||||
*ptp = standard_type(T_RECORD, xalign, size);
|
*ptp = standard_type(T_RECORD, xalign, align(size, xalign));
|
||||||
(*ptp)->rec_scope = scope;
|
(*ptp)->rec_scope = scope;
|
||||||
}
|
}
|
||||||
END
|
END
|
||||||
|
@ -408,8 +404,7 @@ CaseLabels(t_type **ptp; register t_node **pnd;)
|
||||||
}:
|
}:
|
||||||
ConstExpression(pnd)
|
ConstExpression(pnd)
|
||||||
{
|
{
|
||||||
if (*ptp != 0) {
|
if (*ptp != 0 && ChkCompat(pnd, *ptp, "case label")) {
|
||||||
ChkCompat(pnd, *ptp, "case label");
|
|
||||||
}
|
}
|
||||||
nd = *pnd;
|
nd = *pnd;
|
||||||
if (! (nd->nd_type->tp_fund & T_DISCRETE) ||
|
if (! (nd->nd_type->tp_fund & T_DISCRETE) ||
|
||||||
|
|
Loading…
Add table
Reference in a new issue