diff options
author | Roland McGrath <roland@gnu.org> | 2013-10-10 17:43:37 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 2013-10-10 17:43:37 +0000 |
commit | 2b4e983c393c6cd5b9ed786f4c4f5eb9b34b2b77 (patch) | |
tree | 82ef45e027d5626dd5f8ed5230cf740f055acb99 /opcodes/cr16-opc.c | |
parent | 7903e5309890633911c91539e23a407e1f74b959 (diff) | |
download | binutils-gdb-2b4e983c393c6cd5b9ed786f4c4f5eb9b34b2b77.tar.gz |
opcodes/
* cr16-opc.c (REG): Cast NAME to 'reg' enum type to suppress
possible compiler warnings when the union's initializer is
actually meant for the 'preg' enum typed member.
* crx-opc.c (REG): Likewise.
Diffstat (limited to 'opcodes/cr16-opc.c')
-rw-r--r-- | opcodes/cr16-opc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/opcodes/cr16-opc.c b/opcodes/cr16-opc.c index 059794f07e8..ba8ba521291 100644 --- a/opcodes/cr16-opc.c +++ b/opcodes/cr16-opc.c @@ -1,5 +1,5 @@ /* cr16-opc.c -- Table of opcodes for the CR16 processor. - Copyright 2007, 2008, 2010 Free Software Foundation, Inc. + Copyright 2007, 2008, 2010, 2013 Free Software Foundation, Inc. Contributed by M R Swami Reddy (MR.Swami.Reddy@nsc.com) This file is part of the GNU opcodes library. @@ -459,8 +459,11 @@ const unsigned int cr16_num_opcodes = ARRAY_SIZE (cr16_instruction); For example : REG(u4, 0x84, CR16_U_REGTYPE) is interpreted as : - {"u4", u4, 0x84, CR16_U_REGTYPE} */ -#define REG(NAME, N, TYPE) {STRINGX(NAME), {NAME}, N, TYPE} + {"u4", u4, 0x84, CR16_U_REGTYPE} + The union initializer (second member) always refers to the first + member of the union, so cast NAME to that type to avoid possible + compiler warnings when used for CR16_P_REGTYPE cases. */ +#define REG(NAME, N, TYPE) {STRINGX(NAME), {(reg) NAME}, N, TYPE} #define REGP(NAME, BNAME, N, TYPE) {STRINGX(NAME), {BNAME}, N, TYPE} |