diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-07-09 10:54:58 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-07-09 11:01:17 -0700 |
commit | 7f43a321e59b998e731b36039b744138a2d5b776 (patch) | |
tree | 843500d6ede1b517dda49d53ab554823f16dc99e /Autest.c | |
parent | b98078c15874c12dfd4e01594ef9277897ade1df (diff) |
Autest.c: Fix -Wdiscarded-qualifiers warnings
Autest.c: In function ‘main’:
Autest.c:38:21: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
38 | char *name = "XAU-TEST-1";
| ^~~~~~~~~~~~
Autest.c:39:21: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
39 | char *data = "Do not begin the test until instructed to do so.";
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Autest.c:57:23: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
57 | test_data.address = "";
| ^
Autest.c:59:22: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
59 | test_data.number = "";
| ^
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'Autest.c')
-rw-r--r-- | Autest.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -35,8 +35,11 @@ int main (int argc, char **argv) { Xauth test_data; - char *name = "XAU-TEST-1"; - char *data = "Do not begin the test until instructed to do so."; + char defname[] = "XAU-TEST-1"; + char defdata[] = "Do not begin the test until instructed to do so."; + char empty[] = ""; + char *name = defname; + char *data = defdata; char *file = NULL; int state = 0; FILE *output; @@ -54,9 +57,9 @@ main (int argc, char **argv) } test_data.family = 0; test_data.address_length = 0; - test_data.address = ""; + test_data.address = empty; test_data.number_length = 0; - test_data.number = ""; + test_data.number = empty; test_data.name_length = strlen (name); test_data.name = name; test_data.data_length = strlen (data); |