version 1.237, 2021/09/12 17:30:53 |
version 1.238, 2021/09/13 05:21:30 |
Line 1431 new_style_function(sym_t *decl, sym_t *a |
|
Line 1431 new_style_function(sym_t *decl, sym_t *a |
|
{ |
{ |
sym_t *arg, *sym; |
sym_t *arg, *sym; |
scl_t sc; |
scl_t sc; |
int n; |
|
|
|
/* |
/* |
* Declarations of structs/unions/enums in param lists are legal, |
* Declarations of structs/unions/enums in param lists are legal, |
Line 1445 new_style_function(sym_t *decl, sym_t *a |
|
Line 1444 new_style_function(sym_t *decl, sym_t *a |
|
} |
} |
} |
} |
|
|
n = 1; |
|
for (arg = args; arg != NULL; arg = arg->s_next) { |
for (arg = args; arg != NULL; arg = arg->s_next) { |
if (arg->s_type->t_tspec == VOID) { |
if (arg->s_type->t_tspec == VOID && |
if (n > 1 || arg->s_next != NULL) { |
!(arg == args && arg->s_next == NULL)) { |
/* void must be sole parameter */ |
/* void must be sole parameter */ |
error(60); |
error(60); |
arg->s_type = gettyp(INT); |
arg->s_type = gettyp(INT); |
} |
|
} |
} |
n++; |
|
} |
} |
|
|
/* return NULL if first param is VOID */ |
/* return NULL if first param is VOID */ |