many little changes: removed some lint complaints; max_int and max_unsigned
are now constants if NOCROSS is defined; added lexstrict and expr_strict, and changed calls where needed
This commit is contained in:
@@ -39,6 +39,7 @@ char *long2str();
|
||||
char *strncpy();
|
||||
extern char options[];
|
||||
static int gen_error;
|
||||
static int pack_level;
|
||||
struct type **gen_tphead(), **gen_tpmiddle();
|
||||
struct sdef *gen_align_to_next();
|
||||
struct e_stack *p_stack;
|
||||
@@ -47,7 +48,6 @@ struct e_stack *p_stack;
|
||||
/* initial_value recursively guides the initialisation expression.
|
||||
*/
|
||||
/* 3.5 */
|
||||
{ static int pack_level; }
|
||||
|
||||
initial_value(register struct type **tpp; register struct expr **expp;) :
|
||||
{ if (tpp) gen_tpcheck(tpp); }
|
||||
@@ -85,6 +85,7 @@ initial_value_pack(struct type **tpp; struct expr **expp;)
|
||||
p_stack = p;
|
||||
}
|
||||
}
|
||||
if (pack_level < gen_error) gen_error = 0;
|
||||
}
|
||||
'}'
|
||||
;
|
||||
@@ -117,15 +118,15 @@ gen_tpcheck(tpp)
|
||||
switch((tp = *tpp)->tp_fund) {
|
||||
case ARRAY:
|
||||
if (! valid_type(tp->tp_up, "array element"))
|
||||
gen_error = 1;
|
||||
gen_error = pack_level;
|
||||
break;
|
||||
case STRUCT:
|
||||
if (! valid_type(tp, "struct"))
|
||||
gen_error = 1;
|
||||
gen_error = pack_level;
|
||||
break;
|
||||
case UNION:
|
||||
if (! valid_type(tp, "union"))
|
||||
gen_error = 1;
|
||||
gen_error = pack_level;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -150,7 +151,7 @@ gen_simple_exp(tpp, expp)
|
||||
check_and_pad(expp, tpp);
|
||||
break;
|
||||
case ERRONEOUS:
|
||||
gen_error = 1;
|
||||
gen_error = pack_level;
|
||||
break;
|
||||
default:
|
||||
check_ival(expp, tp);
|
||||
@@ -198,7 +199,7 @@ gen_tphead(tpp, nest)
|
||||
register struct sdef *sd;
|
||||
|
||||
if (tpp && *tpp == error_type) {
|
||||
gen_error = 1;
|
||||
gen_error = pack_level;
|
||||
return 0;
|
||||
}
|
||||
if (gen_error) return tpp;
|
||||
@@ -227,7 +228,7 @@ gen_tphead(tpp, nest)
|
||||
#endif
|
||||
if (! sd) {
|
||||
/* something wrong with this struct */
|
||||
gen_error = 1;
|
||||
gen_error = pack_level;
|
||||
p_stack = p->next;
|
||||
free_e_stack(p);
|
||||
return 0;
|
||||
@@ -356,7 +357,6 @@ gen_tpend()
|
||||
free_e_stack(p_stack);
|
||||
p_stack = p;
|
||||
}
|
||||
gen_error = 0;
|
||||
}
|
||||
|
||||
/* check_and_pad() is given a simple initialisation expression
|
||||
@@ -690,12 +690,12 @@ illegal_init_cst(ex)
|
||||
struct expr *ex;
|
||||
{
|
||||
expr_error(ex, "illegal initialisation constant");
|
||||
gen_error = 1;
|
||||
gen_error = pack_level;
|
||||
}
|
||||
|
||||
too_many_initialisers()
|
||||
{
|
||||
error("too many initialisers");
|
||||
gen_error = 1;
|
||||
gen_error = pack_level;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user