fixed old-fashioned decl check
This commit is contained in:
parent
cb7438cb99
commit
e61d1b425d
1 changed files with 9 additions and 7 deletions
|
@ -102,20 +102,22 @@ reject_params(dc)
|
||||||
case of a function definition.
|
case of a function definition.
|
||||||
*/
|
*/
|
||||||
register struct decl_unary *du = dc->dc_decl_unary;
|
register struct decl_unary *du = dc->dc_decl_unary;
|
||||||
|
int err_given = 0;
|
||||||
|
|
||||||
if (dc->dc_formal) {
|
if (dc->dc_formal) {
|
||||||
error("non_empty formal parameter pack");
|
error("non_empty formal parameter pack");
|
||||||
free_formals(dc->dc_formal);
|
free_formals(dc->dc_formal);
|
||||||
dc->dc_formal = 0;
|
dc->dc_formal = 0;
|
||||||
} else {
|
err_given = 1;
|
||||||
if (du && du->du_fund == FUNCTION
|
|
||||||
&& !du->du_proto && !options['o']) {
|
|
||||||
warning("old-fashioned function declaration");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
while (du) {
|
while (du) {
|
||||||
if (du->du_fund == FUNCTION)
|
if (du->du_fund == FUNCTION) {
|
||||||
remove_proto_idfs(du->du_proto);
|
if (du->du_proto) remove_proto_idfs(du->du_proto);
|
||||||
|
else if (! err_given && ! options['o']) {
|
||||||
|
err_given = 1;
|
||||||
|
warning("old-fashioned function declaration");
|
||||||
|
}
|
||||||
|
}
|
||||||
du = du->next;
|
du = du->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue