test: Cast literal strings to (char *) on n_name assignment

The member is declared as n_name so we cannot directly assign a literal
string constant.

Warned-by: gcc
This commit is contained in:
Guillem Jover 2021-03-02 00:48:31 +01:00
parent 04a8fb2469
commit 25e88f6479

View File

@ -55,11 +55,11 @@ int
main(int argc, char **argv)
{
struct nlist nl[] = {
{ .n_un.n_name = "main" },
{ .n_un.n_name = "func_pub" },
{ .n_un.n_name = "data_pub_uninit" },
{ .n_un.n_name = "data_pub_init" },
{ .n_un.n_name = "data_prv_init" },
{ .n_un.n_name = (char *)"main" },
{ .n_un.n_name = (char *)"func_pub" },
{ .n_un.n_name = (char *)"data_pub_uninit" },
{ .n_un.n_name = (char *)"data_pub_init" },
{ .n_un.n_name = (char *)"data_prv_init" },
{ .n_un.n_name = NULL },
};
int rc;