make md_parse_option () take a const char *
authorTrevor Saunders <tbsaunde+binutils@tbsaunde.org>
Sat, 27 Feb 2016 14:35:32 +0000 (09:35 -0500)
committerTrevor Saunders <tbsaunde+binutils@tbsaunde.org>
Tue, 29 Mar 2016 11:43:25 +0000 (07:43 -0400)
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.

74 files changed:
gas/ChangeLog
gas/config/tc-aarch64.c
gas/config/tc-alpha.c
gas/config/tc-arc.c
gas/config/tc-arm.c
gas/config/tc-avr.c
gas/config/tc-bfin.c
gas/config/tc-cr16.c
gas/config/tc-cris.c
gas/config/tc-crx.c
gas/config/tc-d10v.c
gas/config/tc-d30v.c
gas/config/tc-dlx.c
gas/config/tc-epiphany.c
gas/config/tc-fr30.c
gas/config/tc-frv.c
gas/config/tc-ft32.c
gas/config/tc-h8300.c
gas/config/tc-hppa.c
gas/config/tc-i370.c
gas/config/tc-i386.c
gas/config/tc-i860.c
gas/config/tc-i960.c
gas/config/tc-ia64.c
gas/config/tc-ip2k.c
gas/config/tc-iq2000.c
gas/config/tc-lm32.c
gas/config/tc-m32c.c
gas/config/tc-m32r.c
gas/config/tc-m68hc11.c
gas/config/tc-m68k.c
gas/config/tc-mcore.c
gas/config/tc-mep.c
gas/config/tc-metag.c
gas/config/tc-microblaze.c
gas/config/tc-microblaze.h
gas/config/tc-mips.c
gas/config/tc-mmix.c
gas/config/tc-mn10200.c
gas/config/tc-mn10300.c
gas/config/tc-moxie.c
gas/config/tc-msp430.c
gas/config/tc-mt.c
gas/config/tc-nds32.c
gas/config/tc-nds32.h
gas/config/tc-nios2.c
gas/config/tc-ns32k.c
gas/config/tc-or1k.c
gas/config/tc-pdp11.c
gas/config/tc-pj.c
gas/config/tc-ppc.c
gas/config/tc-rl78.c
gas/config/tc-rx.c
gas/config/tc-s390.c
gas/config/tc-score.c
gas/config/tc-sh.c
gas/config/tc-sparc.c
gas/config/tc-spu.c
gas/config/tc-tic30.c
gas/config/tc-tic4x.c
gas/config/tc-tic54x.c
gas/config/tc-tic6x.c
gas/config/tc-tilegx.c
gas/config/tc-tilepro.c
gas/config/tc-v850.c
gas/config/tc-vax.c
gas/config/tc-visium.c
gas/config/tc-xc16x.c
gas/config/tc-xgate.c
gas/config/tc-xstormy16.c
gas/config/tc-xtensa.c
gas/config/tc-z80.c
gas/config/tc-z8k.c
gas/tc.h

index 0980e1c..db2c716 100644 (file)
@@ -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.
index 5c60dd8..8a6ebc8 100644 (file)
@@ -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;
index 4b86d4b..19d4bd2 100644 (file)
@@ -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)
     {
index 736143e..3f4e2d3 100644 (file)
@@ -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)
     {
index eb842d5..bec091c 100644 (file)
@@ -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;
index 9bd164e..b35061e 100644 (file)
@@ -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++);
index c7b9d8d..29754c1 100644 (file)
@@ -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)
     {
index 8a92025..45201ca 100644 (file)
@@ -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;
 }
index a187603..89343f0 100644 (file)
@@ -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;
 }
index 449da49..40a2806 100644 (file)
@@ -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;
 }
index f2855fc..f7f213a 100644 (file)
@@ -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)
     {
index 1ac1605..81051f0 100644 (file)
@@ -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)
     {
index 39b1903..970e297 100644 (file)
@@ -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;
 }
index 4edd560..132a78f 100644 (file)
@@ -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.  */
 }
index 683da32..ad3ffd0 100644 (file)
@@ -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)
     {
index c9aacf8..24baa96 100644 (file)
@@ -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 */
index 88ea4f7..327b393 100644 (file)
@@ -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;
 }
index a620e6d..f50f497 100644 (file)
@@ -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)
index bd2357e..48fdb0f 100644 (file)
@@ -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)
     {
index a20c10c..1b419e8 100644 (file)
@@ -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)
     {
index 610bc2b..55ca5c3 100644 (file)
@@ -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;
index a37da16..ea21669 100644 (file)
@@ -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)
     {
index d09e3cf..8a8f31c 100644 (file)
@@ -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))
index ee91ef9..85f6095 100644 (file)
@@ -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)
index 1baac58..7e4d351 100644 (file)
@@ -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)
     {
index 3ae6392..c5ccfca 100644 (file)
@@ -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;
 }
index 008fd31..a20b9a0 100644 (file)
@@ -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)
     {
index f4fd1f1..4b6e353 100644 (file)
@@ -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)
     {
index 18553bb..7621832 100644 (file)
@@ -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)
     {
index 54ece5f..71fdb26 100644 (file)
@@ -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)
index 8d5a8d7..b89f0a9 100644 (file)
@@ -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)
     {
index 6e57316..dc5c95d 100644 (file)
@@ -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)
     {
index a4ebfcf..6b659d4 100644 (file)
@@ -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)
index b0b2604..d287387 100644 (file)
@@ -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;
 
index 0895ae9..a92e0eb 100644 (file)
@@ -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)
     {
index a468433..0fde831 100644 (file)
@@ -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 *);
index d089362..9679a5e 100644 (file)
@@ -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;
 
index b7bfe14..00543f4 100644 (file)
@@ -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)
     {
index a7fd980..ea2fa8f 100644 (file)
@@ -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;
 }
index 63d790a..4f76677 100644 (file)
@@ -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;
 }
index ae17bb3..aa48c99 100644 (file)
@@ -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)
     {
index 6b762c2..ae28984 100644 (file)
@@ -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)
     {
index 49edb91..c9aa18c 100644 (file)
@@ -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)
     {
index 90b4d27..4c31f43 100644 (file)
@@ -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;
index 5075ec2..81ff40f 100644 (file)
@@ -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.  */
index db31059..399fcf0 100644 (file)
@@ -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)
     {
index 2b88bf4..1f5dbd9 100644 (file)
@@ -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)
     {
index e7c877f..0abbd82 100644 (file)
@@ -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;
 }
index f144754..3d160cf 100644 (file)
@@ -85,7 +85,7 @@ const pseudo_typeS md_pseudo_table[] =
 static struct hash_control *insn_hash = NULL;
 \f
 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 ();
 
index b86fa89..8f6266f 100644 (file)
@@ -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)
     {
index 64a35a0..89c7bfe 100644 (file)
@@ -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;
 
index bd05039..d9f723a 100644 (file)
@@ -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)
     {
index b74ee72..22b5e9b 100644 (file)
@@ -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)
     {
index 8fcbb14..9bcc642 100644 (file)
@@ -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)
     {
index ee195e2..536016f 100644 (file)
@@ -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)
     {
index 1bb6d71..ef07f10 100644 (file)
@@ -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)
     {
index dfb84ef..6f2de4d 100644 (file)
@@ -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.  */
index 69264c1..b658bea 100644 (file)
@@ -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)
     {
index 1853d8d..4ccb820 100644 (file)
@@ -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;
index 21e6e36..956ea5d 100644 (file)
@@ -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)
     {
index d718a33..b889704 100644 (file)
@@ -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)
index 72d1bcc..84fd368 100644 (file)
@@ -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)
     {
index 7897aca..4cebfcf 100644 (file)
@@ -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)
     {
index 90ce09a..1f5890d 100644 (file)
@@ -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)
     {
index 00ff00d..bd762fb 100644 (file)
@@ -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')
     {
index b2e4926..89fc6fc 100644 (file)
@@ -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)
     {
index f4e7c14..4ab5fca 100644 (file)
@@ -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;
index bebdbd3..5e34e09 100644 (file)
@@ -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;
 }
index 70554fe..5b94158 100644 (file)
@@ -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)
     {
index 6ee5be3..7ad3ea8 100644 (file)
@@ -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;
 }
index 180181c..3025d29 100644 (file)
@@ -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)"));
index 281cc71..094b8e6 100644 (file)
@@ -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)
     {
index c09d826..64fca74 100644 (file)
@@ -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)
     {
index dd1831d..3683466 100644 (file)
--- 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);