summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrevor Saunders <tbsaunde+binutils@tbsaunde.org>2016-02-27 09:35:32 -0500
committerTrevor Saunders <tbsaunde+binutils@tbsaunde.org>2016-03-29 07:43:25 -0400
commit17b9d67d4e6bcf2b2b4eecc91b0ff6af35e0fef5 (patch)
tree4b4098adcc3607f221e722ec01c851461afa4ee6
parent30bd735cb042395346c3cb6a28c1fa6cee79bbd8 (diff)
downloadbinutils-gdb-17b9d67d4e6bcf2b2b4eecc91b0ff6af35e0fef5.tar.gz
make md_parse_option () take a const char *
This is mostly just adding const in many places, however there are a couple interesting things. We need to add casts in tc-s390.c and tc-cris.c because they have functions that assign to input_line_pointer an argument that sometimes comes from md_parse_option. Presumably this is safe because those targets never pass literals to md_parse_option (), but this code should probably be improved in the future. Also xtensa passes the argument to strtoll which is a rather odd function, it takes a const char * as argument and returns a pointer into that string as a char * through an out argument, but we can work around that by adding more variables. gas/ChangeLog: 2016-03-29 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * config/tc-aarch64.c (struct aarch64_long_option_table): Ad const qualifier. * config/tc-alpha.c (md_parse_option): Likewise. * config/tc-arc.c (md_parse_option): Likewise. * config/tc-arm.c (struct arm_long_option_table): Likewise. (md_parse_option): Likewise. * config/tc-avr.c (md_parse_option): Likewise. * config/tc-bfin.c (md_parse_option): Likewise. * config/tc-cr16.c (md_parse_option): Likewise. * config/tc-cris.c (s_cris_arch): Likewise. (md_parse_option): Likewise. * config/tc-crx.c (md_parse_option): Likewise. * config/tc-d10v.c (md_parse_option): Likewise. * config/tc-d30v.c (md_parse_option): Likewise. * config/tc-dlx.c (md_parse_option): Likewise. * config/tc-epiphany.c (md_parse_option): Likewise. * config/tc-fr30.c (md_parse_option): Likewise. * config/tc-frv.c (md_parse_option): Likewise. * config/tc-ft32.c (md_parse_option): Likewise. * config/tc-h8300.c (md_parse_option): Likewise. * config/tc-hppa.c (md_parse_option): Likewise. * config/tc-i370.c (md_parse_option): Likewise. * config/tc-i386.c (md_parse_option): Likewise. * config/tc-i860.c (md_parse_option): Likewise. * config/tc-i960.c (md_parse_option): Likewise. * config/tc-ia64.c (md_parse_option): Likewise. * config/tc-ip2k.c (md_parse_option): Likewise. * config/tc-iq2000.c (md_parse_option): Likewise. * config/tc-lm32.c (md_parse_option): Likewise. * config/tc-m32c.c (md_parse_option): Likewise. * config/tc-m32r.c (md_parse_option): Likewise. * config/tc-m68hc11.c (md_parse_option): Likewise. * config/tc-m68k.c (md_parse_option): Likewise. * config/tc-mcore.c (md_parse_option): Likewise. * config/tc-mep.c (md_parse_option): Likewise. * config/tc-metag.c (struct metag_long_option): Likewise. (md_parse_option): Likewise. * config/tc-microblaze.c (md_parse_option): Likewise. * config/tc-microblaze.h (md_parse_option): Remove prototype. * config/tc-mips.c (md_parse_option): Adjust. * config/tc-mmix.c (md_parse_option): Likewise. * config/tc-mn10200.c (md_parse_option): Likewise. * config/tc-mn10300.c (md_parse_option): Likewise. * config/tc-moxie.c (md_parse_option): Likewise. * config/tc-msp430.c (md_parse_option): Likewise. * config/tc-mt.c (md_parse_option): Likewise. * config/tc-nds32.c (md_parse_option): Likewise. * config/tc-nds32.h (nds32_parse_option): Likewise. * config/tc-nios2.c (md_parse_option): Likewise. * config/tc-ns32k.c (md_parse_option): Likewise. * config/tc-or1k.c (md_parse_option): Likewise. * config/tc-pdp11.c (md_parse_option): Likewise. * config/tc-pj.c (md_parse_option): Likewise. * config/tc-ppc.c (md_parse_option): Likewise. * config/tc-rl78.c (md_parse_option): Likewise. * config/tc-rx.c (md_parse_option): Likewise. * config/tc-s390.c (s390_parse_cpu): Likewise. * config/tc-score.c (md_parse_option): Likewise. * config/tc-sh.c (md_parse_option): Likewise. * config/tc-sparc.c (md_parse_option): Likewise. * config/tc-spu.c (md_parse_option): Likewise. * config/tc-tic30.c (md_parse_option): Likewise. * config/tc-tic4x.c (md_parse_option): Likewise. * config/tc-tic54x.c (md_parse_option): Likewise. * config/tc-tic6x.c (md_parse_option): Likewise. * config/tc-tilegx.c (md_parse_option): Likewise. * config/tc-tilepro.c (md_parse_option): Likewise. * config/tc-v850.c (md_parse_option): Likewise. * config/tc-vax.c (md_parse_option): Likewise. * config/tc-visium.c (struct visium_long_option_table): Likewise. * config/tc-xc16x.c (md_parse_option): Likewise. * config/tc-xgate.c (md_parse_option): Likewise. * config/tc-xstormy16.c (md_parse_option): Likewise. * config/tc-xtensa.c (md_parse_option): Likewise. * config/tc-z80.c (md_parse_option): Likewise. * config/tc-z8k.c (md_parse_option): Likewise. * tc.h (md_parse_option): Likewise.
-rw-r--r--gas/ChangeLog80
-rw-r--r--gas/config/tc-aarch64.c10
-rw-r--r--gas/config/tc-alpha.c2
-rw-r--r--gas/config/tc-arc.c2
-rw-r--r--gas/config/tc-arm.c18
-rw-r--r--gas/config/tc-avr.c4
-rw-r--r--gas/config/tc-bfin.c2
-rw-r--r--gas/config/tc-cr16.c2
-rw-r--r--gas/config/tc-cris.c12
-rw-r--r--gas/config/tc-crx.c2
-rw-r--r--gas/config/tc-d10v.c2
-rw-r--r--gas/config/tc-d30v.c2
-rw-r--r--gas/config/tc-dlx.c2
-rw-r--r--gas/config/tc-epiphany.c2
-rw-r--r--gas/config/tc-fr30.c2
-rw-r--r--gas/config/tc-frv.c4
-rw-r--r--gas/config/tc-ft32.c2
-rw-r--r--gas/config/tc-h8300.c2
-rw-r--r--gas/config/tc-hppa.c2
-rw-r--r--gas/config/tc-i370.c2
-rw-r--r--gas/config/tc-i386.c2
-rw-r--r--gas/config/tc-i860.c2
-rw-r--r--gas/config/tc-i960.c4
-rw-r--r--gas/config/tc-ia64.c2
-rw-r--r--gas/config/tc-ip2k.c2
-rw-r--r--gas/config/tc-iq2000.c2
-rw-r--r--gas/config/tc-lm32.c2
-rw-r--r--gas/config/tc-m32c.c2
-rw-r--r--gas/config/tc-m32r.c2
-rw-r--r--gas/config/tc-m68hc11.c2
-rw-r--r--gas/config/tc-m68k.c2
-rw-r--r--gas/config/tc-mcore.c2
-rw-r--r--gas/config/tc-mep.c2
-rw-r--r--gas/config/tc-metag.c10
-rw-r--r--gas/config/tc-microblaze.c2
-rw-r--r--gas/config/tc-microblaze.h1
-rw-r--r--gas/config/tc-mips.c2
-rw-r--r--gas/config/tc-mmix.c2
-rw-r--r--gas/config/tc-mn10200.c2
-rw-r--r--gas/config/tc-mn10300.c2
-rw-r--r--gas/config/tc-moxie.c2
-rw-r--r--gas/config/tc-msp430.c2
-rw-r--r--gas/config/tc-mt.c2
-rw-r--r--gas/config/tc-nds32.c2
-rw-r--r--gas/config/tc-nds32.h2
-rw-r--r--gas/config/tc-nios2.c2
-rw-r--r--gas/config/tc-ns32k.c2
-rw-r--r--gas/config/tc-or1k.c2
-rw-r--r--gas/config/tc-pdp11.c8
-rw-r--r--gas/config/tc-pj.c2
-rw-r--r--gas/config/tc-ppc.c2
-rw-r--r--gas/config/tc-rl78.c2
-rw-r--r--gas/config/tc-rx.c2
-rw-r--r--gas/config/tc-s390.c6
-rw-r--r--gas/config/tc-score.c2
-rw-r--r--gas/config/tc-sh.c2
-rw-r--r--gas/config/tc-sparc.c2
-rw-r--r--gas/config/tc-spu.c2
-rw-r--r--gas/config/tc-tic30.c2
-rw-r--r--gas/config/tc-tic4x.c2
-rw-r--r--gas/config/tc-tic54x.c4
-rw-r--r--gas/config/tc-tic6x.c2
-rw-r--r--gas/config/tc-tilegx.c2
-rw-r--r--gas/config/tc-tilepro.c2
-rw-r--r--gas/config/tc-v850.c2
-rw-r--r--gas/config/tc-vax.c2
-rw-r--r--gas/config/tc-visium.c6
-rw-r--r--gas/config/tc-xc16x.c2
-rw-r--r--gas/config/tc-xgate.c2
-rw-r--r--gas/config/tc-xstormy16.c2
-rw-r--r--gas/config/tc-xtensa.c20
-rw-r--r--gas/config/tc-z80.c2
-rw-r--r--gas/config/tc-z8k.c2
-rw-r--r--gas/tc.h2
74 files changed, 194 insertions, 113 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 0980e1ca8a5..db2c7163763 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,85 @@
2016-03-29 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
+ * config/tc-aarch64.c (struct aarch64_long_option_table): Ad const
+ qualifier.
+ * config/tc-alpha.c (md_parse_option): Likewise.
+ * config/tc-arc.c (md_parse_option): Likewise.
+ * config/tc-arm.c (struct arm_long_option_table): Likewise.
+ (md_parse_option): Likewise.
+ * config/tc-avr.c (md_parse_option): Likewise.
+ * config/tc-bfin.c (md_parse_option): Likewise.
+ * config/tc-cr16.c (md_parse_option): Likewise.
+ * config/tc-cris.c (s_cris_arch): Likewise.
+ (md_parse_option): Likewise.
+ * config/tc-crx.c (md_parse_option): Likewise.
+ * config/tc-d10v.c (md_parse_option): Likewise.
+ * config/tc-d30v.c (md_parse_option): Likewise.
+ * config/tc-dlx.c (md_parse_option): Likewise.
+ * config/tc-epiphany.c (md_parse_option): Likewise.
+ * config/tc-fr30.c (md_parse_option): Likewise.
+ * config/tc-frv.c (md_parse_option): Likewise.
+ * config/tc-ft32.c (md_parse_option): Likewise.
+ * config/tc-h8300.c (md_parse_option): Likewise.
+ * config/tc-hppa.c (md_parse_option): Likewise.
+ * config/tc-i370.c (md_parse_option): Likewise.
+ * config/tc-i386.c (md_parse_option): Likewise.
+ * config/tc-i860.c (md_parse_option): Likewise.
+ * config/tc-i960.c (md_parse_option): Likewise.
+ * config/tc-ia64.c (md_parse_option): Likewise.
+ * config/tc-ip2k.c (md_parse_option): Likewise.
+ * config/tc-iq2000.c (md_parse_option): Likewise.
+ * config/tc-lm32.c (md_parse_option): Likewise.
+ * config/tc-m32c.c (md_parse_option): Likewise.
+ * config/tc-m32r.c (md_parse_option): Likewise.
+ * config/tc-m68hc11.c (md_parse_option): Likewise.
+ * config/tc-m68k.c (md_parse_option): Likewise.
+ * config/tc-mcore.c (md_parse_option): Likewise.
+ * config/tc-mep.c (md_parse_option): Likewise.
+ * config/tc-metag.c (struct metag_long_option): Likewise.
+ (md_parse_option): Likewise.
+ * config/tc-microblaze.c (md_parse_option): Likewise.
+ * config/tc-microblaze.h (md_parse_option): Remove prototype.
+ * config/tc-mips.c (md_parse_option): Adjust.
+ * config/tc-mmix.c (md_parse_option): Likewise.
+ * config/tc-mn10200.c (md_parse_option): Likewise.
+ * config/tc-mn10300.c (md_parse_option): Likewise.
+ * config/tc-moxie.c (md_parse_option): Likewise.
+ * config/tc-msp430.c (md_parse_option): Likewise.
+ * config/tc-mt.c (md_parse_option): Likewise.
+ * config/tc-nds32.c (md_parse_option): Likewise.
+ * config/tc-nds32.h (nds32_parse_option): Likewise.
+ * config/tc-nios2.c (md_parse_option): Likewise.
+ * config/tc-ns32k.c (md_parse_option): Likewise.
+ * config/tc-or1k.c (md_parse_option): Likewise.
+ * config/tc-pdp11.c (md_parse_option): Likewise.
+ * config/tc-pj.c (md_parse_option): Likewise.
+ * config/tc-ppc.c (md_parse_option): Likewise.
+ * config/tc-rl78.c (md_parse_option): Likewise.
+ * config/tc-rx.c (md_parse_option): Likewise.
+ * config/tc-s390.c (s390_parse_cpu): Likewise.
+ * config/tc-score.c (md_parse_option): Likewise.
+ * config/tc-sh.c (md_parse_option): Likewise.
+ * config/tc-sparc.c (md_parse_option): Likewise.
+ * config/tc-spu.c (md_parse_option): Likewise.
+ * config/tc-tic30.c (md_parse_option): Likewise.
+ * config/tc-tic4x.c (md_parse_option): Likewise.
+ * config/tc-tic54x.c (md_parse_option): Likewise.
+ * config/tc-tic6x.c (md_parse_option): Likewise.
+ * config/tc-tilegx.c (md_parse_option): Likewise.
+ * config/tc-tilepro.c (md_parse_option): Likewise.
+ * config/tc-v850.c (md_parse_option): Likewise.
+ * config/tc-vax.c (md_parse_option): Likewise.
+ * config/tc-visium.c (struct visium_long_option_table): Likewise.
+ * config/tc-xc16x.c (md_parse_option): Likewise.
+ * config/tc-xgate.c (md_parse_option): Likewise.
+ * config/tc-xstormy16.c (md_parse_option): Likewise.
+ * config/tc-xtensa.c (md_parse_option): Likewise.
+ * config/tc-z80.c (md_parse_option): Likewise.
+ * config/tc-z8k.c (md_parse_option): Likewise.
+ * tc.h (md_parse_option): Likewise.
+
+2016-03-29 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
+
* config/tc-bfin.c (gencode): Use XOBNEW obstack_alloc () wrapper.
* config/tc-hppa.c (fix_new_hppa): Likewise.
(pa_vtable_entry): Likewise.
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 5c60dd8ab3e..8a6ebc8787c 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -7825,7 +7825,7 @@ struct aarch64_long_option_table
{
const char *option; /* Substring to match. */
const char *help; /* Help information. */
- int (*func) (char *subopt); /* Function to decode sub-option. */
+ int (*func) (const char *subopt); /* Function to decode sub-option. */
char *deprecated; /* If non-null, print this message. */
};
@@ -7917,7 +7917,7 @@ aarch64_parse_features (const char *str, const aarch64_feature_set **opt_p,
}
static int
-aarch64_parse_cpu (char *str)
+aarch64_parse_cpu (const char *str)
{
const struct aarch64_cpu_option_table *opt;
const char *ext = strchr (str, '+');
@@ -7949,7 +7949,7 @@ aarch64_parse_cpu (char *str)
}
static int
-aarch64_parse_arch (char *str)
+aarch64_parse_arch (const char *str)
{
const struct aarch64_arch_option_table *opt;
const char *ext = strchr (str, '+');
@@ -7994,7 +7994,7 @@ static const struct aarch64_option_abi_value_table aarch64_abis[] = {
};
static int
-aarch64_parse_abi (char *str)
+aarch64_parse_abi (const char *str)
{
const struct aarch64_option_abi_value_table *opt;
size_t optlen = strlen (str);
@@ -8029,7 +8029,7 @@ static struct aarch64_long_option_table aarch64_long_opts[] = {
};
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
struct aarch64_option_table *opt;
struct aarch64_long_option_table *lopt;
diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c
index 4b86d4beb5a..19d4bd26974 100644
--- a/gas/config/tc-alpha.c
+++ b/gas/config/tc-alpha.c
@@ -5602,7 +5602,7 @@ md_atof (int type, char *litP, int *sizeP)
/* Take care of the target-specific command-line options. */
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index 736143e3215..3f4e2d38085 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -2913,7 +2913,7 @@ arc_parse_name (const char *name,
arc700, av2em, av2hs. */
int
-md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index eb842d510e6..bec091c15d4 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -25581,7 +25581,7 @@ struct arm_long_option_table
{
const char * option; /* Substring to match. */
const char * help; /* Help information. */
- int (* func) (char * subopt); /* Function to decode sub-option. */
+ int (* func) (const char * subopt); /* Function to decode sub-option. */
const char * deprecated; /* If non-null, print this message. */
};
@@ -25709,7 +25709,7 @@ arm_parse_extension (const char *str, const arm_feature_set **opt_p)
}
static bfd_boolean
-arm_parse_cpu (char *str)
+arm_parse_cpu (const char *str)
{
const struct arm_cpu_option_table *opt;
const char *ext = strchr (str, '+');
@@ -25759,7 +25759,7 @@ arm_parse_cpu (char *str)
}
static bfd_boolean
-arm_parse_arch (char *str)
+arm_parse_arch (const char *str)
{
const struct arm_arch_option_table *opt;
const char *ext = strchr (str, '+');
@@ -25794,7 +25794,7 @@ arm_parse_arch (char *str)
}
static bfd_boolean
-arm_parse_fpu (char * str)
+arm_parse_fpu (const char * str)
{
const struct arm_option_fpu_value_table * opt;
@@ -25810,7 +25810,7 @@ arm_parse_fpu (char * str)
}
static bfd_boolean
-arm_parse_float_abi (char * str)
+arm_parse_float_abi (const char * str)
{
const struct arm_option_value_table * opt;
@@ -25827,7 +25827,7 @@ arm_parse_float_abi (char * str)
#ifdef OBJ_ELF
static bfd_boolean
-arm_parse_eabi (char * str)
+arm_parse_eabi (const char * str)
{
const struct arm_option_value_table *opt;
@@ -25843,7 +25843,7 @@ arm_parse_eabi (char * str)
#endif
static bfd_boolean
-arm_parse_it_mode (char * str)
+arm_parse_it_mode (const char * str)
{
bfd_boolean ret = TRUE;
@@ -25866,7 +25866,7 @@ arm_parse_it_mode (char * str)
}
static bfd_boolean
-arm_ccs_mode (char * unused ATTRIBUTE_UNUSED)
+arm_ccs_mode (const char * unused ATTRIBUTE_UNUSED)
{
codecomposer_syntax = TRUE;
arm_comment_chars[0] = ';';
@@ -25896,7 +25896,7 @@ struct arm_long_option_table arm_long_opts[] =
};
int
-md_parse_option (int c, char * arg)
+md_parse_option (int c, const char * arg)
{
struct arm_option_table *opt;
const struct arm_legacy_option_table *fopt;
diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c
index 9bd164e3dbf..b35061ef88b 100644
--- a/gas/config/tc-avr.c
+++ b/gas/config/tc-avr.c
@@ -555,7 +555,7 @@ avr_set_arch (int dummy ATTRIBUTE_UNUSED)
}
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
@@ -566,7 +566,7 @@ md_parse_option (int c, char *arg)
{
char *t = s;
- char *arg1 = arg;
+ const char *arg1 = arg;
do
*t = TOLOWER (*arg1++);
diff --git a/gas/config/tc-bfin.c b/gas/config/tc-bfin.c
index c7b9d8d0716..29754c15d33 100644
--- a/gas/config/tc-bfin.c
+++ b/gas/config/tc-bfin.c
@@ -348,7 +348,7 @@ size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c ATTRIBUTE_UNUSED, const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-cr16.c b/gas/config/tc-cr16.c
index 8a920259c1b..45201caa6ac 100644
--- a/gas/config/tc-cr16.c
+++ b/gas/config/tc-cr16.c
@@ -702,7 +702,7 @@ md_undefined_symbol (char *name)
GAS does not understand. */
int
-md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c ATTRIBUTE_UNUSED, const char *arg ATTRIBUTE_UNUSED)
{
return 0;
}
diff --git a/gas/config/tc-cris.c b/gas/config/tc-cris.c
index a187603ede6..89343f01dd9 100644
--- a/gas/config/tc-cris.c
+++ b/gas/config/tc-cris.c
@@ -119,7 +119,7 @@ enum cris_archs
arch_cris_any_v0_v10, arch_crisv32, arch_cris_common_v10_v32
};
-static enum cris_archs cris_arch_from_string (char **);
+static enum cris_archs cris_arch_from_string (const char **);
static int cris_insn_ver_valid_for_arch (enum cris_insn_version_usage,
enum cris_archs);
@@ -3802,7 +3802,7 @@ cris_number_to_imm (char *bufp, long val, int n, fixS *fixP, segT seg)
GAS does not understand. */
int
-md_parse_option (int arg, char *argp ATTRIBUTE_UNUSED)
+md_parse_option (int arg, const char *argp ATTRIBUTE_UNUSED)
{
switch (arg)
{
@@ -3842,7 +3842,7 @@ md_parse_option (int arg, char *argp ATTRIBUTE_UNUSED)
case OPTION_ARCH:
{
- char *str = argp;
+ const char *str = argp;
enum cris_archs argarch = cris_arch_from_string (&str);
if (argarch == arch_cris_unknown)
@@ -4271,7 +4271,7 @@ s_cris_dtpoff (int bytes)
arch_cris_unknown is returned. */
static enum cris_archs
-cris_arch_from_string (char **str)
+cris_arch_from_string (const char **str)
{
static const struct cris_arch_struct
{
@@ -4398,7 +4398,7 @@ s_cris_arch (int dummy ATTRIBUTE_UNUSED)
would be more useful than confusing, implementation-wise and
user-wise. */
- char *str = input_line_pointer;
+ const char *str = input_line_pointer;
enum cris_archs arch = cris_arch_from_string (&str);
if (arch == arch_cris_unknown)
@@ -4414,7 +4414,7 @@ s_cris_arch (int dummy ATTRIBUTE_UNUSED)
else if (arch != cris_arch)
as_bad (_(".arch <arch> requires a matching --march=... option"));
- input_line_pointer = str;
+ input_line_pointer = (char *) str;
demand_empty_rest_of_line ();
return;
}
diff --git a/gas/config/tc-crx.c b/gas/config/tc-crx.c
index 449da496f57..40a28064fa1 100644
--- a/gas/config/tc-crx.c
+++ b/gas/config/tc-crx.c
@@ -451,7 +451,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, fragS *fragP)
GAS does not understand. */
int
-md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c ATTRIBUTE_UNUSED, const char *arg ATTRIBUTE_UNUSED)
{
return 0;
}
diff --git a/gas/config/tc-d10v.c b/gas/config/tc-d10v.c
index f2855fcd1e4..f7f213a87d6 100644
--- a/gas/config/tc-d10v.c
+++ b/gas/config/tc-d10v.c
@@ -222,7 +222,7 @@ md_show_usage (FILE *stream)
}
int
-md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-d30v.c b/gas/config/tc-d30v.c
index 1ac160501dd..81051f09712 100644
--- a/gas/config/tc-d30v.c
+++ b/gas/config/tc-d30v.c
@@ -245,7 +245,7 @@ md_show_usage (FILE *stream)
}
int
-md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-dlx.c b/gas/config/tc-dlx.c
index 39b19038bc0..970e297b94a 100644
--- a/gas/config/tc-dlx.c
+++ b/gas/config/tc-dlx.c
@@ -1076,7 +1076,7 @@ size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c ATTRIBUTE_UNUSED,
- char *arg ATTRIBUTE_UNUSED)
+ const char *arg ATTRIBUTE_UNUSED)
{
return 0;
}
diff --git a/gas/config/tc-epiphany.c b/gas/config/tc-epiphany.c
index 4edd560f201..132a78ff565 100644
--- a/gas/config/tc-epiphany.c
+++ b/gas/config/tc-epiphany.c
@@ -116,7 +116,7 @@ size_t md_longopts_size = sizeof (md_longopts);
const char * md_shortopts = "";
int
-md_parse_option (int c ATTRIBUTE_UNUSED, char * arg ATTRIBUTE_UNUSED)
+md_parse_option (int c ATTRIBUTE_UNUSED, const char * arg ATTRIBUTE_UNUSED)
{
return 0; /* No target-specific options. */
}
diff --git a/gas/config/tc-fr30.c b/gas/config/tc-fr30.c
index 683da32f7ce..ad3ffd0e2b1 100644
--- a/gas/config/tc-fr30.c
+++ b/gas/config/tc-fr30.c
@@ -65,7 +65,7 @@ size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c ATTRIBUTE_UNUSED,
- char *arg ATTRIBUTE_UNUSED)
+ const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-frv.c b/gas/config/tc-frv.c
index c9aacf8c2d2..24baa96364a 100644
--- a/gas/config/tc-frv.c
+++ b/gas/config/tc-frv.c
@@ -262,7 +262,7 @@ size_t md_longopts_size = sizeof (md_longopts);
static int g_switch_value = 8;
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
@@ -337,7 +337,7 @@ md_parse_option (int c, char *arg)
case OPTION_CPU:
{
- char *p;
+ const char *p;
int cpu_flags = EF_FRV_CPU_GENERIC;
/* Identify the processor type */
diff --git a/gas/config/tc-ft32.c b/gas/config/tc-ft32.c
index 88ea4f7dfbe..327b393fdba 100644
--- a/gas/config/tc-ft32.c
+++ b/gas/config/tc-ft32.c
@@ -457,7 +457,7 @@ size_t md_longopts_size = sizeof (md_longopts);
/* We have no target specific options yet, so these next
two functions are empty. */
int
-md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c ATTRIBUTE_UNUSED, const char *arg ATTRIBUTE_UNUSED)
{
return 0;
}
diff --git a/gas/config/tc-h8300.c b/gas/config/tc-h8300.c
index a620e6dd63f..f50f4976f09 100644
--- a/gas/config/tc-h8300.c
+++ b/gas/config/tc-h8300.c
@@ -2197,7 +2197,7 @@ const struct mach_func mach_table[] =
};
int
-md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c ATTRIBUTE_UNUSED, const char *arg ATTRIBUTE_UNUSED)
{
unsigned int i;
switch (c)
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index bd2357eaac2..48fdb0f8772 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -1653,7 +1653,7 @@ struct option md_longopts[] =
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-i370.c b/gas/config/tc-i370.c
index a20c10cf84a..1b419e82a91 100644
--- a/gas/config/tc-i370.c
+++ b/gas/config/tc-i370.c
@@ -358,7 +358,7 @@ struct option md_longopts[] =
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 610bc2b1fc7..55ca5c3d7dd 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -9698,7 +9698,7 @@ struct option md_longopts[] =
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
unsigned int j;
char *arch, *next;
diff --git a/gas/config/tc-i860.c b/gas/config/tc-i860.c
index a37da16d7ec..ea21669273e 100644
--- a/gas/config/tc-i860.c
+++ b/gas/config/tc-i860.c
@@ -1084,7 +1084,7 @@ struct option md_longopts[] = {
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c
index d09e3cfbc53..8a8f31cd626 100644
--- a/gas/config/tc-i960.c
+++ b/gas/config/tc-i960.c
@@ -1827,7 +1827,7 @@ static const struct tabentry arch_tab[] =
};
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
@@ -1847,7 +1847,7 @@ md_parse_option (int c, char *arg)
case 'A':
{
const struct tabentry *tp;
- char *p = arg;
+ const char *p = arg;
for (tp = arch_tab; tp->flag != NULL; tp++)
if (!strcmp (p, tp->flag))
diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c
index ee91ef950c6..85f609586fd 100644
--- a/gas/config/tc-ia64.c
+++ b/gas/config/tc-ia64.c
@@ -6981,7 +6981,7 @@ emit_one_bundle (void)
}
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
diff --git a/gas/config/tc-ip2k.c b/gas/config/tc-ip2k.c
index 1baac58271b..7e4d351710e 100644
--- a/gas/config/tc-ip2k.c
+++ b/gas/config/tc-ip2k.c
@@ -113,7 +113,7 @@ size_t md_longopts_size = sizeof (md_longopts);
const char * md_shortopts = "";
int
-md_parse_option (int c ATTRIBUTE_UNUSED, char * arg ATTRIBUTE_UNUSED)
+md_parse_option (int c ATTRIBUTE_UNUSED, const char * arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-iq2000.c b/gas/config/tc-iq2000.c
index 3ae63929e2f..c5ccfcac57f 100644
--- a/gas/config/tc-iq2000.c
+++ b/gas/config/tc-iq2000.c
@@ -118,7 +118,7 @@ size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c ATTRIBUTE_UNUSED,
- char * arg ATTRIBUTE_UNUSED)
+ const char * arg ATTRIBUTE_UNUSED)
{
return 0;
}
diff --git a/gas/config/tc-lm32.c b/gas/config/tc-lm32.c
index 008fd317f11..a20b9a0351c 100644
--- a/gas/config/tc-lm32.c
+++ b/gas/config/tc-lm32.c
@@ -132,7 +132,7 @@ md_show_usage (FILE * fp)
/* Parse command line options. */
int
-md_parse_option (int c, char * arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char * arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-m32c.c b/gas/config/tc-m32c.c
index f4fd1f1b8f2..4b6e353098b 100644
--- a/gas/config/tc-m32c.c
+++ b/gas/config/tc-m32c.c
@@ -105,7 +105,7 @@ set_isa (enum isa_attr isa_num)
static void s_bss (int);
int
-md_parse_option (int c, char * arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char * arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-m32r.c b/gas/config/tc-m32r.c
index 18553bb7a9d..76218324bd4 100644
--- a/gas/config/tc-m32r.c
+++ b/gas/config/tc-m32r.c
@@ -266,7 +266,7 @@ parallel (void)
}
int
-md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-m68hc11.c b/gas/config/tc-m68hc11.c
index 54ece5f41de..71fdb2670e6 100644
--- a/gas/config/tc-m68hc11.c
+++ b/gas/config/tc-m68hc11.c
@@ -490,7 +490,7 @@ m68hc11_print_statistics (FILE *file)
}
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
get_default_target ();
switch (c)
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c
index 8d5a8d7d3ba..b89f0a97c9b 100644
--- a/gas/config/tc-m68k.c
+++ b/gas/config/tc-m68k.c
@@ -7540,7 +7540,7 @@ struct option md_longopts[] = {
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
diff --git a/gas/config/tc-mcore.c b/gas/config/tc-mcore.c
index 6e573164905..dc5c95d0859 100644
--- a/gas/config/tc-mcore.c
+++ b/gas/config/tc-mcore.c
@@ -1650,7 +1650,7 @@ struct option md_longopts[] =
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char * arg)
+md_parse_option (int c, const char * arg)
{
switch (c)
{
diff --git a/gas/config/tc-mep.c b/gas/config/tc-mep.c
index a4ebfcf5da9..6b659d47649 100644
--- a/gas/config/tc-mep.c
+++ b/gas/config/tc-mep.c
@@ -195,7 +195,7 @@ static int optbits = 0;
static int optbitset = 0;
int
-md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
{
int i, idx;
switch (c)
diff --git a/gas/config/tc-metag.c b/gas/config/tc-metag.c
index b0b26042184..d28738719a4 100644
--- a/gas/config/tc-metag.c
+++ b/gas/config/tc-metag.c
@@ -5821,7 +5821,7 @@ static const struct metag_core_option metag_dsps[] =
/* Parse a CPU command line option. */
static int
-metag_parse_cpu (char * str)
+metag_parse_cpu (const char * str)
{
const struct metag_core_option * opt;
int optlen;
@@ -5847,7 +5847,7 @@ metag_parse_cpu (char * str)
/* Parse an FPU command line option. */
static int
-metag_parse_fpu (char * str)
+metag_parse_fpu (const char * str)
{
const struct metag_core_option * opt;
int optlen;
@@ -5873,7 +5873,7 @@ metag_parse_fpu (char * str)
/* Parse a DSP command line option. */
static int
-metag_parse_dsp (char * str)
+metag_parse_dsp (const char * str)
{
const struct metag_core_option * opt;
int optlen;
@@ -5901,7 +5901,7 @@ struct metag_long_option
{
const char * option; /* Substring to match. */
const char * help; /* Help information. */
- int (* func) (char * subopt); /* Function to decode sub-option. */
+ int (* func) (const char * subopt); /* Function to decode sub-option. */
const char * deprecated; /* If non-null, print this message. */
};
@@ -5917,7 +5917,7 @@ struct metag_long_option metag_long_opts[] =
};
int
-md_parse_option (int c, char * arg)
+md_parse_option (int c, const char * arg)
{
struct metag_long_option *lopt;
diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
index 0895ae9d6f3..a92e0ebdbe1 100644
--- a/gas/config/tc-microblaze.c
+++ b/gas/config/tc-microblaze.c
@@ -2458,7 +2458,7 @@ tc_gen_reloc (asection * section ATTRIBUTE_UNUSED, fixS * fixp)
}
int
-md_parse_option (int c, char * arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char * arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-microblaze.h b/gas/config/tc-microblaze.h
index a468433bf4e..0fde831f906 100644
--- a/gas/config/tc-microblaze.h
+++ b/gas/config/tc-microblaze.h
@@ -101,7 +101,6 @@ extern void md_begin (void);
extern void md_assemble (char *);
extern symbolS * md_undefined_symbol (char *);
extern char * md_atof (int, char *, int *);
-extern int md_parse_option (int, char *);
extern void md_show_usage (FILE *);
extern void md_convert_frag (bfd *, segT, fragS *);
extern void md_operand (expressionS *);
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index d089362413c..9679a5e8501 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -14046,7 +14046,7 @@ mips_set_option_string (const char **string_ptr, const char *new_value)
}
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
unsigned int i;
diff --git a/gas/config/tc-mmix.c b/gas/config/tc-mmix.c
index b7bfe14f601..00543f44c4d 100644
--- a/gas/config/tc-mmix.c
+++ b/gas/config/tc-mmix.c
@@ -640,7 +640,7 @@ get_putget_operands (struct mmix_opcode *insn, char *operands,
/* Handle MMIX-specific option. */
int
-md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-mn10200.c b/gas/config/tc-mn10200.c
index a7fd980aeed..ea2fa8f0f32 100644
--- a/gas/config/tc-mn10200.c
+++ b/gas/config/tc-mn10200.c
@@ -303,7 +303,7 @@ none yet\n"));
int
md_parse_option (int c ATTRIBUTE_UNUSED,
- char *arg ATTRIBUTE_UNUSED)
+ const char *arg ATTRIBUTE_UNUSED)
{
return 0;
}
diff --git a/gas/config/tc-mn10300.c b/gas/config/tc-mn10300.c
index 63d790ad882..4f76677af5e 100644
--- a/gas/config/tc-mn10300.c
+++ b/gas/config/tc-mn10300.c
@@ -444,7 +444,7 @@ none yet\n"));
}
int
-md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c ATTRIBUTE_UNUSED, const char *arg ATTRIBUTE_UNUSED)
{
return 0;
}
diff --git a/gas/config/tc-moxie.c b/gas/config/tc-moxie.c
index ae17bb33824..aa48c997822 100644
--- a/gas/config/tc-moxie.c
+++ b/gas/config/tc-moxie.c
@@ -612,7 +612,7 @@ size_t md_longopts_size = sizeof (md_longopts);
const char *md_shortopts = "";
int
-md_parse_option (int c ATTRIBUTE_UNUSED, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c ATTRIBUTE_UNUSED, const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-msp430.c b/gas/config/tc-msp430.c
index 6b762c2ca25..ae28984dc75 100644
--- a/gas/config/tc-msp430.c
+++ b/gas/config/tc-msp430.c
@@ -1329,7 +1329,7 @@ msp430_mcu_data [] =
};
int
-md_parse_option (int c, char * arg)
+md_parse_option (int c, const char * arg)
{
switch (c)
{
diff --git a/gas/config/tc-mt.c b/gas/config/tc-mt.c
index 49edb919a34..c9aa18cd931 100644
--- a/gas/config/tc-mt.c
+++ b/gas/config/tc-mt.c
@@ -101,7 +101,7 @@ enum mt_architectures
static enum mt_architectures mt_arch = ms1_16_002;
int
-md_parse_option (int c ATTRIBUTE_UNUSED, char * arg)
+md_parse_option (int c ATTRIBUTE_UNUSED, const char * arg)
{
switch (c)
{
diff --git a/gas/config/tc-nds32.c b/gas/config/tc-nds32.c
index 90b4d27165d..4c31f43a287 100644
--- a/gas/config/tc-nds32.c
+++ b/gas/config/tc-nds32.c
@@ -3189,7 +3189,7 @@ nds32_all_ext (void)
recognized. This will be handled by the generic code. */
int
-nds32_parse_option (int c, char *arg)
+nds32_parse_option (int c, const char *arg)
{
struct nds32_parse_option_table *coarse_tune;
struct nds32_set_option_table *fine_tune;
diff --git a/gas/config/tc-nds32.h b/gas/config/tc-nds32.h
index 5075ec20a95..81ff40f6c31 100644
--- a/gas/config/tc-nds32.h
+++ b/gas/config/tc-nds32.h
@@ -44,7 +44,7 @@
/* as.c. */
/* Extend GAS command line option handling capability. */
-extern int nds32_parse_option (int, char *);
+extern int nds32_parse_option (int, const char *);
extern void nds32_after_parse_args (void);
/* The endianness of the target format may change based on command
line arguments. */
diff --git a/gas/config/tc-nios2.c b/gas/config/tc-nios2.c
index db31059fefb..399fcf0810a 100644
--- a/gas/config/tc-nios2.c
+++ b/gas/config/tc-nios2.c
@@ -3540,7 +3540,7 @@ nios2_use_arch (const char *arch)
/* The following functions are called by machine-independent parts of
the assembler. */
int
-md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-ns32k.c b/gas/config/tc-ns32k.c
index 2b88bf4462c..1f5dbd90cd8 100644
--- a/gas/config/tc-ns32k.c
+++ b/gas/config/tc-ns32k.c
@@ -2123,7 +2123,7 @@ struct option md_longopts[] =
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
diff --git a/gas/config/tc-or1k.c b/gas/config/tc-or1k.c
index e7c877f853b..0abbd824937 100644
--- a/gas/config/tc-or1k.c
+++ b/gas/config/tc-or1k.c
@@ -67,7 +67,7 @@ size_t md_longopts_size = sizeof (md_longopts);
unsigned long or1k_machine = 0; /* default */
int
-md_parse_option (int c ATTRIBUTE_UNUSED, char * arg ATTRIBUTE_UNUSED)
+md_parse_option (int c ATTRIBUTE_UNUSED, const char * arg ATTRIBUTE_UNUSED)
{
return 0;
}
diff --git a/gas/config/tc-pdp11.c b/gas/config/tc-pdp11.c
index f1447541d84..3d160cfb097 100644
--- a/gas/config/tc-pdp11.c
+++ b/gas/config/tc-pdp11.c
@@ -85,7 +85,7 @@ const pseudo_typeS md_pseudo_table[] =
static struct hash_control *insn_hash = NULL;
static int
-set_option (char *arg)
+set_option (const char *arg)
{
int yes = 1;
@@ -1043,7 +1043,7 @@ md_create_long_jump (char *ptr ATTRIBUTE_UNUSED,
}
static int
-set_cpu_model (char *arg)
+set_cpu_model (const char *arg)
{
char buf[4];
char *model = buf;
@@ -1159,7 +1159,7 @@ set_cpu_model (char *arg)
}
static int
-set_machine_model (char *arg)
+set_machine_model (const char *arg)
{
if (strncmp (arg, "pdp-11/", 7) != 0
&& strncmp (arg, "pdp11/", 6) != 0
@@ -1246,7 +1246,7 @@ size_t md_longopts_size = sizeof (md_longopts);
See if it's a processor-specific option. */
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
init_defaults ();
diff --git a/gas/config/tc-pj.c b/gas/config/tc-pj.c
index b86fa8975bf..8f6266f8a1d 100644
--- a/gas/config/tc-pj.c
+++ b/gas/config/tc-pj.c
@@ -333,7 +333,7 @@ struct option md_longopts[] =
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 64a35a01278..89c7bfe45dd 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -1078,7 +1078,7 @@ const struct option md_longopts[] = {
const size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
ppc_cpu_t new_cpu;
diff --git a/gas/config/tc-rl78.c b/gas/config/tc-rl78.c
index bd0503987e0..d9f723af79d 100644
--- a/gas/config/tc-rl78.c
+++ b/gas/config/tc-rl78.c
@@ -308,7 +308,7 @@ struct option md_longopts[] =
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char * arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char * arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-rx.c b/gas/config/tc-rx.c
index b74ee7212f7..22b5e9bb6fa 100644
--- a/gas/config/tc-rx.c
+++ b/gas/config/tc-rx.c
@@ -122,7 +122,7 @@ struct cpu_type cpu_type_list[] =
};
int
-md_parse_option (int c ATTRIBUTE_UNUSED, char * arg ATTRIBUTE_UNUSED)
+md_parse_option (int c ATTRIBUTE_UNUSED, const char * arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c
index 8fcbb1482e9..9bcc6423a1c 100644
--- a/gas/config/tc-s390.c
+++ b/gas/config/tc-s390.c
@@ -262,7 +262,7 @@ s390_target_format (void)
In case of an error, S390_OPCODE_MAXCPU is returned. */
static unsigned int
-s390_parse_cpu (char * arg,
+s390_parse_cpu (const char * arg,
unsigned int * ret_flags,
bfd_boolean allow_extensions)
{
@@ -324,7 +324,7 @@ s390_parse_cpu (char * arg,
ilp_bak = input_line_pointer;
if (icpu != S390_OPCODE_MAXCPU)
{
- input_line_pointer = arg;
+ input_line_pointer = (char *) arg;
*ret_flags = (cpu_table[icpu].flags & S390_INSTR_FLAG_FACILITY_MASK);
while (*input_line_pointer == '+' && allow_extensions)
@@ -368,7 +368,7 @@ s390_parse_cpu (char * arg,
}
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
diff --git a/gas/config/tc-score.c b/gas/config/tc-score.c
index ee195e2d37c..536016f75bb 100644
--- a/gas/config/tc-score.c
+++ b/gas/config/tc-score.c
@@ -7716,7 +7716,7 @@ score_set_mach (const char *arg)
}
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index 1bb6d7179cf..ef07f10d1d0 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -3180,7 +3180,7 @@ struct option md_longopts[] =
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index dfb84ef6829..6f2de4dd128 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -490,7 +490,7 @@ struct option md_longopts[] = {
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
/* We don't get a chance to initialize anything before we're called,
so handle that now. */
diff --git a/gas/config/tc-spu.c b/gas/config/tc-spu.c
index 69264c11ae8..b658bea3532 100644
--- a/gas/config/tc-spu.c
+++ b/gas/config/tc-spu.c
@@ -156,7 +156,7 @@ static int emulate_apuasm;
static int use_dd2 = 1;
int
-md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-tic30.c b/gas/config/tc-tic30.c
index 1853d8d3b8d..4ccb820842a 100644
--- a/gas/config/tc-tic30.c
+++ b/gas/config/tc-tic30.c
@@ -1163,7 +1163,7 @@ md_apply_fix (fixS *fixP,
int
md_parse_option (int c ATTRIBUTE_UNUSED,
- char *arg ATTRIBUTE_UNUSED)
+ const char *arg ATTRIBUTE_UNUSED)
{
debug ("In md_parse_option()\n");
return 0;
diff --git a/gas/config/tc-tic4x.c b/gas/config/tc-tic4x.c
index 21e6e3662df..956ea5d9d6c 100644
--- a/gas/config/tc-tic4x.c
+++ b/gas/config/tc-tic4x.c
@@ -2710,7 +2710,7 @@ md_estimate_size_before_relax (fragS *fragP ATTRIBUTE_UNUSED,
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
diff --git a/gas/config/tc-tic54x.c b/gas/config/tc-tic54x.c
index d718a33967c..b8897045973 100644
--- a/gas/config/tc-tic54x.c
+++ b/gas/config/tc-tic54x.c
@@ -2461,7 +2461,7 @@ const pseudo_typeS md_pseudo_table[] =
};
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
@@ -2490,7 +2490,7 @@ md_parse_option (int c, char *arg)
break;
case OPTION_STDERR_TO_FILE:
{
- char *filename = arg;
+ const char *filename = arg;
FILE *fp = fopen (filename, "w+");
if (fp == NULL)
diff --git a/gas/config/tc-tic6x.c b/gas/config/tc-tic6x.c
index 72d1bcc97d4..84fd368766f 100644
--- a/gas/config/tc-tic6x.c
+++ b/gas/config/tc-tic6x.c
@@ -265,7 +265,7 @@ tic6x_use_pid (const char *arg)
/* Parse a target-specific option. */
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
diff --git a/gas/config/tc-tilegx.c b/gas/config/tc-tilegx.c
index 7897aca44c3..4cebfcf4368 100644
--- a/gas/config/tc-tilegx.c
+++ b/gas/config/tc-tilegx.c
@@ -99,7 +99,7 @@ struct option md_longopts[] =
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-tilepro.c b/gas/config/tc-tilepro.c
index 90ce09a7f47..1f5890dfa2f 100644
--- a/gas/config/tc-tilepro.c
+++ b/gas/config/tc-tilepro.c
@@ -72,7 +72,7 @@ struct option md_longopts[] =
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c
index 00ff00d3713..bd762fb5b83 100644
--- a/gas/config/tc-v850.c
+++ b/gas/config/tc-v850.c
@@ -1562,7 +1562,7 @@ md_show_usage (FILE *stream)
}
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
if (c != 'm')
{
diff --git a/gas/config/tc-vax.c b/gas/config/tc-vax.c
index b2e492628a1..89fc6fc5e26 100644
--- a/gas/config/tc-vax.c
+++ b/gas/config/tc-vax.c
@@ -2210,7 +2210,7 @@ struct option md_longopts[] =
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
diff --git a/gas/config/tc-visium.c b/gas/config/tc-visium.c
index f4e7c1462db..4ab5fcacad9 100644
--- a/gas/config/tc-visium.c
+++ b/gas/config/tc-visium.c
@@ -282,12 +282,12 @@ struct visium_long_option_table
{
const char *option; /* Substring to match. */
const char *help; /* Help information. */
- int (*func) (char *subopt); /* Function to decode sub-option. */
+ int (*func) (const char *subopt); /* Function to decode sub-option. */
const char *deprecated; /* If non-null, print this message. */
};
static int
-visium_parse_arch (char *str)
+visium_parse_arch (const char *str)
{
struct visium_arch_option_table *opt;
@@ -317,7 +317,7 @@ static struct visium_long_option_table visium_long_opts[] =
};
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
struct visium_option_table *opt;
struct visium_long_option_table *lopt;
diff --git a/gas/config/tc-xc16x.c b/gas/config/tc-xc16x.c
index bebdbd3f0d6..5e34e09d49a 100644
--- a/gas/config/tc-xc16x.c
+++ b/gas/config/tc-xc16x.c
@@ -220,7 +220,7 @@ md_show_usage (FILE * stream)
int
md_parse_option (int c ATTRIBUTE_UNUSED,
- char *arg ATTRIBUTE_UNUSED)
+ const char *arg ATTRIBUTE_UNUSED)
{
return 0;
}
diff --git a/gas/config/tc-xgate.c b/gas/config/tc-xgate.c
index 70554fe028b..5b941588f16 100644
--- a/gas/config/tc-xgate.c
+++ b/gas/config/tc-xgate.c
@@ -200,7 +200,7 @@ md_atof (int type, char *litP, int *sizeP)
}
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
diff --git a/gas/config/tc-xstormy16.c b/gas/config/tc-xstormy16.c
index 6ee5be3f513..7ad3ea8190c 100644
--- a/gas/config/tc-xstormy16.c
+++ b/gas/config/tc-xstormy16.c
@@ -66,7 +66,7 @@ size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c ATTRIBUTE_UNUSED,
- char * arg ATTRIBUTE_UNUSED)
+ const char * arg ATTRIBUTE_UNUSED)
{
return 0;
}
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c
index 180181c35c6..3025d29f238 100644
--- a/gas/config/tc-xtensa.c
+++ b/gas/config/tc-xtensa.c
@@ -814,7 +814,7 @@ size_t md_longopts_size = sizeof md_longopts;
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
@@ -952,20 +952,21 @@ md_parse_option (int c, char *arg)
case option_target_hardware:
{
int earliest, latest = 0;
+ char *end;
if (*arg == 0 || *arg == '-')
as_fatal (_("invalid target hardware version"));
- earliest = strtol (arg, &arg, 0);
+ earliest = strtol (arg, &end, 0);
- if (*arg == 0)
+ if (*end == 0)
latest = earliest;
- else if (*arg == '-')
+ else if (*end == '-')
{
- if (*++arg == 0)
+ if (*++end == 0)
as_fatal (_("invalid target hardware version"));
- latest = strtol (arg, &arg, 0);
+ latest = strtol (end, &end, 0);
}
- if (*arg != 0)
+ if (*end != 0)
as_fatal (_("invalid target hardware version"));
xtensa_setup_hw_workarounds (earliest, latest);
@@ -1008,12 +1009,13 @@ md_parse_option (int c, char *arg)
case option_auto_litpool_limit:
{
int value = 0;
+ char *end;
if (auto_litpool_limit < 0)
as_fatal (_("no-auto-litpools is incompatible with auto-litpool-limit"));
if (*arg == 0 || *arg == '-')
as_fatal (_("invalid auto-litpool-limit argument"));
- value = strtol (arg, &arg, 10);
- if (*arg != 0)
+ value = strtol (arg, &end, 10);
+ if (*end != 0)
as_fatal (_("invalid auto-litpool-limit argument"));
if (value < 100 || value > 10000)
as_fatal (_("invalid auto-litpool-limit argument (range is 100-10000)"));
diff --git a/gas/config/tc-z80.c b/gas/config/tc-z80.c
index 281cc71948c..094b8e6e125 100644
--- a/gas/config/tc-z80.c
+++ b/gas/config/tc-z80.c
@@ -81,7 +81,7 @@ static int ins_err = INS_R800;
static int ins_used = INS_Z80;
int
-md_parse_option (int c, char* arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char* arg ATTRIBUTE_UNUSED)
{
switch (c)
{
diff --git a/gas/config/tc-z8k.c b/gas/config/tc-z8k.c
index c09d8260098..64fca74595c 100644
--- a/gas/config/tc-z8k.c
+++ b/gas/config/tc-z8k.c
@@ -1303,7 +1303,7 @@ struct option md_longopts[] =
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
diff --git a/gas/tc.h b/gas/tc.h
index dd1831da740..3683466b32c 100644
--- a/gas/tc.h
+++ b/gas/tc.h
@@ -25,7 +25,7 @@
extern const pseudo_typeS md_pseudo_table[];
char * md_atof (int, char *, int *);
-int md_parse_option (int, char *);
+int md_parse_option (int, const char *);
void md_show_usage (FILE *);
void md_assemble (char *);
void md_begin (void);