ret = get_unary_unsigned(min_align, &min_align_value);
if (ret) {
fprintf(fd, "[error] %s: unexpected unary expression for structure \"align\" attribute\n", __func__);
- ret = -EINVAL;
goto error;
}
}
return NULL;
}
size = right->u.unary_expression.u.unsigned_constant;
+ if (!size) {
+ fprintf(fd, "[error] %s: integer size: expecting non-zero constant\n",
+ __func__);
+ return NULL;
+ }
has_size = 1;
} else if (!strcmp(left->u.unary_expression.u.string, "align")) {
if (right->u.unary_expression.type != UNARY_UNSIGNED_CONSTANT) {
goto error;
}
clock->absolute = ret;
+ ret = 0;
} else {
fprintf(fd, "[warning] %s: attribute \"%s\" is unknown in clock declaration.\n", __func__, left);
}