xtensa: Fix implicit enum conversions
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 22 Oct 2015 13:46:32 +0000 (09:46 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Thu, 22 Oct 2015 13:47:47 +0000 (09:47 -0400)
XTREG is used with raw numbers, like:

...
  XTREG( 78,312,32, 4, 4,0x02d7,0x0007,-2, 2,0x1000,excsave7,    0,0,0,0,0,0)
  XTREG( 79,316, 8, 4, 4,0x02e0,0x0007,-2, 2,0x1000,cpenable,    0,0,0,0,0,0)
  XTREG( 80,320,22, 4, 4,0x02e2,0x000b,-2, 2,0x1000,interrupt,   0,0,0,0,0,0)
  XTREG( 81,324,22, 4, 4,0x02e2,0x000d,-2, 2,0x1000,intset,      0,0,0,0,0,0)
...

So just add the explicit cast to the macro.

In file included from /home/pedro/gdb/mygit/src/gdb/xtensa-config.c:25:0:
/home/pedro/gdb/mygit/src/gdb/xtensa-tdep.h:289:2: error: invalid conversion from â€˜int’ to â€˜call_abi_t’ [-fpermissive]
  }
  ^

gdb/ChangeLog:

* xtensa-tdep.h (XTREG): Add casts.
(XTREG_END): Likewise.

gdb/ChangeLog
gdb/xtensa-tdep.h

index 6fefc63774cea624c28adff25d6ad49466bf8b3b..0df8246272af187715db3cbc30bbbe81ecbc73f9 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-22  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * xtensa-tdep.h (XTREG): Add casts.
+       (XTREG_END): Likewise.
+
 2015-10-22  Simon Marchi  <simon.marchi@polymtl.ca>
 
        * solib-spu.c (spu_bfd_iovec_pread): Add (gdb_byte *) cast.
index fbf0e1d9d0f7b3c6019cd85ced5b6570d978cb04..275f40dc1b6e520f3cff66ec9c9078273f9762d5 100644 (file)
@@ -124,9 +124,13 @@ typedef struct
 
 /*  For xtensa-config.c to expand to the structure above.  */
 #define XTREG(index,ofs,bsz,sz,al,tnum,flg,cp,ty,gr,name,fet,sto,mas,ct,x,y) \
-       {#name, ofs, ty, ((gr) | ((xtRegisterGroupNCP >> 2) << (cp + 2))), \
+       {#name, ofs, (xtensa_register_type_t) (ty), \
+       ((xtensa_register_group_t) \
+        ((gr) | ((xtRegisterGroupNCP >> 2) << (cp + 2)))), \
         ct, bsz, sz, al, tnum, flg, cp, mas, fet, sto},
-#define XTREG_END {0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0},
+#define XTREG_END \
+  {0, 0, (xtensa_register_type_t) 0, (xtensa_register_group_t) 0,      \
+   0, 0, 0, 0, -1, 0, 0, 0, 0, 0},
 
 #define XTENSA_REGISTER_FLAGS_PRIVILEGED       0x0001
 #define XTENSA_REGISTER_FLAGS_READABLE         0x0002
This page took 0.031693 seconds and 4 git commands to generate.