From: tbsaunde+binutils@tbsaunde.org
To: binutils@sourceware.org
Cc: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
Subject: [PATCH 5/7] tc-i960.c: add some casts when assigning literals to args[i]
Date: Wed, 30 Mar 2016 01:08:00 -0000 [thread overview]
Message-ID: <1459300381-19313-6-git-send-email-tbsaunde+binutils@tbsaunde.org> (raw)
In-Reply-To: <1459300381-19313-1-git-send-email-tbsaunde+binutils@tbsaunde.org>
From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
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-29 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* config/tc-i960.c (parse_ldconst): Cast to char * when assigning to
args[0].
---
gas/config/tc-i960.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c
index 45e8a44..667ab4c 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,<reg>. */
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.1.4
next prev parent reply other threads:[~2016-03-30 1:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-30 1:08 [PATCH 0/7] enable -Wwrite-strings for gas tbsaunde+binutils
2016-03-30 1:08 ` [PATCH 7/7] " tbsaunde+binutils
2016-04-01 11:22 ` Jiong Wang
2016-04-01 12:17 ` Trevor Saunders
2016-04-01 12:40 ` Alan Modra
2016-04-01 13:10 ` Trevor Saunders
2016-03-30 1:08 ` tbsaunde+binutils [this message]
2016-03-30 1:08 ` [PATCH 3/7] cast to char * when assigning to optarg tbsaunde+binutils
2016-03-30 1:08 ` [PATCH 2/7] work around get_symbol_name () in sparc and ia64 tbsaunde+binutils
2016-03-30 1:08 ` [PATCH 1/7] cast literal to char * when assigning to input_line_ptr tbsaunde+binutils
2016-03-30 1:14 ` [PATCH 4/7] cast the arg to md_assemble () to char * tbsaunde+binutils
2016-03-30 1:14 ` [PATCH 6/7] make xtensa_section_rename () take const " tbsaunde+binutils
2016-03-31 10:34 ` [PATCH 0/7] enable -Wwrite-strings for gas Alan Modra
2016-05-01 16:44 ` Andrew Pinski
2016-05-02 18:25 ` Trevor Saunders
2016-05-02 19:38 ` Andrew Pinski
2016-05-03 8:12 ` Nick Clifton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1459300381-19313-6-git-send-email-tbsaunde+binutils@tbsaunde.org \
--to=tbsaunde+binutils@tbsaunde.org \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).