From e2c7dcae81a7da1353b7c3d5db210fca479c9c4c Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Thu, 24 Mar 2016 07:52:39 -0400 Subject: [PATCH] tc-i960.c: add some casts when assigning literals to args[i] parse_ldconst () takes a char ** as a in / out argument, and sometimes points args[0] to a constant string. Then in some cases after parse_ldconst () returns md_assemble () twiddles the contents of arg[0]. So it seems like it would take some work to avoid these casts, and its not really clear that work is worth it. gas/ChangeLog: 2016-03-31 Trevor Saunders * config/tc-i960.c (parse_ldconst): Cast to char * when assigning to args[0]. --- gas/ChangeLog | 5 +++++ gas/config/tc-i960.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index ba3eeab0edc..90ed4aee8c2 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2016-03-31 Trevor Saunders + + * config/tc-i960.c (parse_ldconst): Cast to char * when assigning to + args[0]. + 2016-03-31 Trevor Saunders * config/tc-m32c.c (m32c_md_end): cast the argument to md_assemble to diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c index 45e8a44e586..667ab4cf24f 100644 --- a/gas/config/tc-i960.c +++ b/gas/config/tc-i960.c @@ -1246,7 +1246,7 @@ parse_ldconst (char *arg[]) /* See above. */ { default: /* We're dependent on one or more symbols -- use "lda". */ - arg[0] = "lda"; + arg[0] = (char *) "lda"; break; case O_constant: @@ -1263,26 +1263,26 @@ parse_ldconst (char *arg[]) /* See above. */ lda xxx,. */ n = offs (e); if ((0 <= n) && (n <= 31)) - arg[0] = "mov"; + arg[0] = (char *) "mov"; else if ((-31 <= n) && (n <= -1)) { - arg[0] = "subo"; + arg[0] = (char *) "subo"; arg[3] = arg[2]; sprintf (buf, "%d", -n); arg[1] = buf; - arg[2] = "0"; + arg[2] = (char *) "0"; } else if ((32 <= n) && (n <= 62)) { - arg[0] = "addo"; + arg[0] = (char *) "addo"; arg[3] = arg[2]; - arg[1] = "31"; + arg[1] = (char *) "31"; sprintf (buf, "%d", n - 31); arg[2] = buf; } else if ((shift = shift_ok (n)) != 0) { - arg[0] = "shlo"; + arg[0] = (char *) "shlo"; arg[3] = arg[2]; sprintf (buf, "%d", shift); arg[1] = buf; @@ -1290,7 +1290,7 @@ parse_ldconst (char *arg[]) /* See above. */ arg[2] = buf2; } else - arg[0] = "lda"; + arg[0] = (char *) "lda"; break; case O_illegal: -- 2.30.2