if (d->u.function.parameters) {
d->u.function.variadic = gsl_rng_uniform(rng->rng) < 0.5;
+ } else if (gsl_rng_uniform(rng->rng) < 0.5) {
+ struct cdecl *param;
+
+ /* We will never generate (void) above; do it here. */
+ param = malloc_nofail(sizeof *param);
+ *param = (struct cdecl) { 0 };
+
+ param->declarators = malloc_nofail(sizeof *param->declarators);
+ *param->declarators = (struct cdecl_declarator) {
+ .type = CDECL_DECL_NULL,
+ };
+
+ param->specifiers = malloc_nofail(sizeof *param->specifiers);
+ *param->specifiers = (struct cdecl_declspec) {
+ .type = CDECL_TYPE_VOID,
+ };
+
+ d->u.function.parameters = param;
}
}
break;
case 2:
gen_function(rng, d);
+ if (p && p->type == CDECL_DECL_POINTER) {
+ struct cdecl_pointer *ptr = &p->u.pointer;
+
+ gen_free_declspecs(ptr->qualifiers);
+ ptr->qualifiers = gen_qualifiers(rng, false);
+ }
limit = 1;
break;
default: