- struct cdecl_declspec *spec;
- struct cdecl *param;
-
- if (d->type != CDECL_DECL_FUNCTION)
- return 0;
-
- for (param = d->u.function.parameters; param; param = param->next) {
- if (!valid_declspecs(param, false))
- return -1;
-
- /* Check for "void" function parameters as a special case. */
- for (spec = param->specifiers; spec; spec = spec->next) {
- if (param->declarators->type != CDECL_DECL_NULL)
- continue;
- if (spec->type != CDECL_TYPE_VOID)
- continue;
-
- if (spec != param->specifiers || spec->next != NULL) {
- cdecl__errmsg(CDECL__EVOIDPARAM);
- return -1;
- } else if (d->u.function.parameters->next) {
- cdecl__errmsg(CDECL__EVOIDPARAM);
- return -1;
- } else if (d->u.function.variadic) {
- cdecl__errmsg(CDECL__EVOIDPARAM);
- return -1;
- }
- }
- }
-