case 'Y': {
const symbol_t *const symbol = va_arg(ap, const symbol_t*);
- fputs(symbol->string, stderr);
+ if (symbol == NULL)
+ fputs("(null)", stderr);
+ else
+ fputs(symbol->string, stderr);
break;
}
declaration_t *declaration = parse_declarator(&specifiers, /*may_be_abstract=*/true);
- semantic_parameter(declaration);
-
return declaration;
}
type->unspecified_parameters = 1;
goto parameters_finished;
}
- if(token.type == T_void && look_ahead(1)->type == ')') {
- next_token();
- goto parameters_finished;
- }
declaration_t *declaration;
declaration_t *last_declaration = NULL;
DECLARATION_START
declaration = parse_parameter();
+ /* func(void) is not a parameter */
+ if (last_parameter == NULL
+ && token.type == ')'
+ && skip_typeref(declaration->type) == type_void) {
+ goto parameters_finished;
+ }
+ semantic_parameter(declaration);
+
parameter = obstack_alloc(type_obst, sizeof(parameter[0]));
memset(parameter, 0, sizeof(parameter[0]));
parameter->type = declaration->type;