public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: tbsaunde+binutils@tbsaunde.org
To: binutils@sourceware.org
Cc: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
Subject: [PATCH 2/7] work around get_symbol_name () in sparc and ia64
Date: Wed, 30 Mar 2016 01:08:00 -0000	[thread overview]
Message-ID: <1459300381-19313-3-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>

get_symbol_name () returns a char * in a out arg, which means we need to cast
to assign a literal to the variable passed to get_symbol_name ().  It seems
like better APIs than get_symbol_name () could be provided, but that seems like
a fair amount of work so just casting seems to be the betterthing to do for
now.

gas/ChangeLog:

2016-03-29  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-ia64.c (md_assemble): Add temporary variable to pass to
	get_symbol_name ().
	* config/tc-sparc.c (s_register): Cast a literal to char * in
	assignment.
---
 gas/config/tc-ia64.c  | 6 ++++--
 gas/config/tc-sparc.c | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c
index 85f6095..a50b61e 100644
--- a/gas/config/tc-ia64.c
+++ b/gas/config/tc-ia64.c
@@ -10667,7 +10667,8 @@ check_dv (struct ia64_opcode *idesc)
 void
 md_assemble (char *str)
 {
-  char *saved_input_line_pointer, *mnemonic;
+  char *saved_input_line_pointer, *temp;
+  const char *mnemonic;
   const struct pseudo_opcode *pdesc;
   struct ia64_opcode *idesc;
   unsigned char qp_regno;
@@ -10679,7 +10680,8 @@ md_assemble (char *str)
 
   /* extract the opcode (mnemonic):  */
 
-  ch = get_symbol_name (&mnemonic);
+  ch = get_symbol_name (&temp);
+  mnemonic = temp;
   pdesc = (struct pseudo_opcode *) hash_find (md.pseudo_hash, mnemonic);
   if (pdesc)
     {
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index 6f2de4d..9f30d3a 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -4413,7 +4413,7 @@ s_register (int ignore ATTRIBUTE_UNUSED)
       if (regname[0] == 'i')
 	regname = NULL;
       else
-	regname = "";
+	regname = (char *) "";
     }
   else
     {
-- 
2.1.4

  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 ` [PATCH 5/7] tc-i960.c: add some casts when assigning literals to args[i] tbsaunde+binutils
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 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-3-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).