[LTP] [PATCH v2 2/3] check: Add LTP-005 null termination check on test.tags
Cyril Hrubis
chrubis@suse.cz
Tue Dec 7 11:54:08 CET 2021
Hi!
> +/* Checks if some struct array initializer is terminated with a blank
> + * (zeroed) item i.e. {}
> + */
> +static bool is_terminated_with_null_struct(const struct symbol *const sym)
> +{
> + const struct expression *const arr_init = sym->initializer;
> + const struct expression *item_init =
> + last_ptr_list((struct ptr_list *)arr_init->expr_list);
> +
> + if (item_init->type == EXPR_POS)
> + item_init = item_init->init_expr;
> +
> + return ptr_list_empty((struct ptr_list *)item_init->expr_list);
> +}
Looks good now.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list