This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] cast the arg to md_assemble () to char *


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f854977c2364fb17ba20e6a505f5d78f2c645679

commit f854977c2364fb17ba20e6a505f5d78f2c645679
Author: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
Date:   Sun Mar 20 01:13:05 2016 -0400

    cast the arg to md_assemble () to char *
    
    For these targets its not clear how md_assemble can usefully be split up so
    that part can take const char *.  There is also a fair number of targets that
    need md_assemble () to take a char *, so we can't easily make the argument
    const.  So since there isn't many callers it seems easiest to just add a couple
    of casts.
    
    gas/ChangeLog:
    
    2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
    
    	* config/tc-m32c.c (m32c_md_end): cast the argument to md_assemble to
    	char *.
    	(m32c_indirect_operand): Likewise.
    	* config/tc-nds32.c (do_pseudo_b): Likewise.
    	(do_pseudo_bal): Likewise.
    	(do_pseudo_ls_bhw): Likewise.

Diff:
---
 gas/ChangeLog         |  9 +++++++++
 gas/config/tc-m32c.c  |  8 ++++----
 gas/config/tc-nds32.c | 10 +++++-----
 3 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index ffb04fd..ba3eeab 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,14 @@
 2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
 
+	* config/tc-m32c.c (m32c_md_end): cast the argument to md_assemble to
+	char *.
+	(m32c_indirect_operand): Likewise.
+	* config/tc-nds32.c (do_pseudo_b): Likewise.
+	(do_pseudo_bal): Likewise.
+	(do_pseudo_ls_bhw): Likewise.
+
+2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
+
 	* as.c (parse_args): Cast literal to char * when assigning to optarg.
 
 2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
diff --git a/gas/config/tc-m32c.c b/gas/config/tc-m32c.c
index 4b6e353..5496f7e 100644
--- a/gas/config/tc-m32c.c
+++ b/gas/config/tc-m32c.c
@@ -200,7 +200,7 @@ m32c_md_end (void)
       /* Pad with nops for objdump.  */
       n_nops = (32 - ((insn_size) % 32)) / 8;
       for (i = 1; i <= n_nops; i++)
-	md_assemble ("nop");
+	md_assemble ((char *) "nop");
     }
 }
 
@@ -317,11 +317,11 @@ m32c_indirect_operand (char *str)
       }
 
   if (indirection[1] != none && indirection[2] != none)
-    md_assemble ("src-dest-indirect");
+    md_assemble ((char *) "src-dest-indirect");
   else if (indirection[1] != none)
-    md_assemble ("src-indirect");
+    md_assemble ((char *) "src-indirect");
   else if (indirection[2] != none)
-    md_assemble ("dest-indirect");
+    md_assemble ((char *) "dest-indirect");
 
   md_assemble (new_str);
   free (new_str);
diff --git a/gas/config/tc-nds32.c b/gas/config/tc-nds32.c
index 4c31f43..0d7d346 100644
--- a/gas/config/tc-nds32.c
+++ b/gas/config/tc-nds32.c
@@ -2202,8 +2202,8 @@ do_pseudo_b (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED)
     {
       md_assemblef ("sethi $ta,hi20(%s)", arg_label);
       md_assemblef ("ori $ta,$ta,lo12(%s)", arg_label);
-      md_assemble  ("add $ta,$ta,$gp");
-      md_assemble  ("jr $ta");
+      md_assemble  ((char *) "add $ta,$ta,$gp");
+      md_assemble  ((char *) "jr $ta");
     }
   else
     {
@@ -2223,8 +2223,8 @@ do_pseudo_bal (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED)
     {
       md_assemblef ("sethi $ta,hi20(%s)", arg_label);
       md_assemblef ("ori $ta,$ta,lo12(%s)", arg_label);
-      md_assemble  ("add $ta,$ta,$gp");
-      md_assemble ("jral $ta");
+      md_assemble  ((char *) "add $ta,$ta,$gp");
+      md_assemble ((char *) "jral $ta");
     }
   else
     {
@@ -2483,7 +2483,7 @@ do_pseudo_ls_bhw (int argc ATTRIBUTE_UNUSED, char *argv[], int pv)
 	  /* lw */
 	  md_assemblef ("sethi $ta,hi20(%s)", argv[1]);
 	  md_assemblef ("ori $ta,$ta,lo12(%s)", argv[1]);
-	  md_assemble ("lw $ta,[$gp+$ta]");	/* Load address word.  */
+	  md_assemble ((char *) "lw $ta,[$gp+$ta]");	/* Load address word.  */
 	  if (addend < 0x10000 && addend >= -0x10000)
 	    {
 	      md_assemblef ("%c%c%si %s,[$ta+(%d)]", ls, size, sign, argv[0], addend);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]