diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2020-05-26 06:46:26 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-05-26 06:53:36 -0700 |
commit | e67e940f5d9102fb452b87aca441a2829a67d66b (patch) | |
tree | 20eb98b59087da5bc459895645e73d2a4e822a51 /gas | |
parent | 9e7cb4c359e6a86550bca296db617fb4c8068c1a (diff) | |
download | gdb-e67e940f5d9102fb452b87aca441a2829a67d66b.zip gdb-e67e940f5d9102fb452b87aca441a2829a67d66b.tar.gz gdb-e67e940f5d9102fb452b87aca441a2829a67d66b.tar.bz2 |
gas: Silence GCC 10 warning on tc-crx.c
opcode/crx.h has
typedef enum
{
...
MAX_REG
}
reg;
typedef enum
{
c0 = MAX_REG,
}
copreg;
tc-crx.c has
static int
getreg_image (reg r)
{
...
/* Check whether the register is in registers table. */
if (r < MAX_REG)
rreg = &crx_regtab[r];
/* Check whether the register is in coprocessor registers table. */
else if (r < (int) MAX_COPREG)
rreg = &crx_copregtab[r-MAX_REG];
}
Change getreg_image's argument type to int and replace fragP->fr_literal
with &fragP->fr_literal[0] to silence GCC 10 warning.
PR gas/26044
* config/tc-crx.c (getreg_image): Change argument type to int.
(md_convert_frag): Replace fragP->fr_literal with
&fragP->fr_literal[0].
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 7 | ||||
-rw-r--r-- | gas/config/tc-crx.c | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 291a357..9a1dc3b 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,6 +1,13 @@ 2020-05-26 H.J. Lu <hongjiu.lu@intel.com> PR gas/26044 + * config/tc-crx.c (getreg_image): Change argument type to int. + (md_convert_frag): Replace fragP->fr_literal with + &fragP->fr_literal[0]. + +2020-05-26 H.J. Lu <hongjiu.lu@intel.com> + + PR gas/26044 * onfig/tc-score.c (s3_do_macro_bcmp): Replace overlapping sprintf with memmove. diff --git a/gas/config/tc-crx.c b/gas/config/tc-crx.c index 09efa09..f0b3246 100644 --- a/gas/config/tc-crx.c +++ b/gas/config/tc-crx.c @@ -153,7 +153,7 @@ static void handle_LoadStor (const char *); static int get_cinv_parameters (const char *); static long getconstant (long, int); static op_err check_range (long *, int, unsigned int, int); -static int getreg_image (reg); +static int getreg_image (int); static void parse_operands (ins *, char *); static void parse_insn (ins *, char *); static void print_operand (int, int, argument *); @@ -402,7 +402,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, fragS *fragP) { /* 'opcode' points to the start of the instruction, whether we need to change the instruction's fixed encoding. */ - char *opcode = fragP->fr_literal + fragP->fr_fix; + char *opcode = &fragP->fr_literal[0] + fragP->fr_fix; bfd_reloc_code_real_type reloc; subseg_change (sec, 0); @@ -1107,7 +1107,7 @@ get_cinv_parameters (const char *operand) issue an error. */ static int -getreg_image (reg r) +getreg_image (int r) { const reg_entry *rreg; char *reg_name; |