Fixed two bugs:
- did not accept arrays in 'if (a) ...' - did not detect too few parameters in functions with ellipsis prototypes
This commit is contained in:
parent
c3c1b918f0
commit
34d6b23ba6
2 changed files with 9 additions and 2 deletions
|
@ -489,7 +489,15 @@ opnd2logical(expp, oper)
|
||||||
{
|
{
|
||||||
int fund = (*expp)->ex_type->tp_fund;
|
int fund = (*expp)->ex_type->tp_fund;
|
||||||
|
|
||||||
|
if (fund == FUNCTION || fund == ARRAY) {
|
||||||
|
expr_warning(*expp, "%s operand to %s",
|
||||||
|
symbol2str(fund),
|
||||||
|
symbol2str(oper));
|
||||||
|
if (fund == FUNCTION) function2pointer(*expp);
|
||||||
|
else array2pointer(*expp);
|
||||||
|
}
|
||||||
#ifndef NOBITFIELD
|
#ifndef NOBITFIELD
|
||||||
|
else
|
||||||
if (fund == FIELD)
|
if (fund == FIELD)
|
||||||
field2arith(expp);
|
field2arith(expp);
|
||||||
#endif NOBITFIELD
|
#endif NOBITFIELD
|
||||||
|
|
|
@ -465,9 +465,8 @@ call_proto(expp)
|
||||||
} else
|
} else
|
||||||
any2parameter(estack[ecnt]);
|
any2parameter(estack[ecnt]);
|
||||||
}
|
}
|
||||||
if (pcnt >= 0 && !(pstack[0]->pl_flag & PL_ELLIPSIS))
|
if (pcnt > 0 || (pcnt == 0 && !(pstack[0]->pl_flag & PL_ELLIPSIS)))
|
||||||
expr_error(*expp, "fewer parameters than specified in prototype");
|
expr_error(*expp, "fewer parameters than specified in prototype");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (pl && !(pl->pl_flag & PL_VOID))
|
if (pl && !(pl->pl_flag & PL_VOID))
|
||||||
expr_error(*expp, "fewer parameters than specified in prototype");
|
expr_error(*expp, "fewer parameters than specified in prototype");
|
||||||
|
|
Loading…
Add table
Reference in a new issue