From 25e88f6479466f2164c5dcf4a0798002e43f342e Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 2 Mar 2021 00:48:31 +0100 Subject: [PATCH] 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 --- test/nlist.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/nlist.c b/test/nlist.c index 82e24e9..a2ac228 100644 --- a/test/nlist.c +++ b/test/nlist.c @@ -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;