bfd/libhppa.h: Make C++ compatible
authorPedro Alves <palves@redhat.com>
Thu, 29 Oct 2015 12:55:03 +0000 (12:55 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 29 Oct 2015 12:56:27 +0000 (12:56 +0000)
Fixes this when GDB is built in C++ mode:

 In file included from /home/pedro/gdb/mygit/src/gdb/../bfd/som.h:27:0,
  from /home/pedro/gdb/mygit/src/gdb/somread.c:31:
 /home/pedro/gdb/mygit/src/gdb/../bfd/libhppa.h: In function ‘int bfd_hppa_insn2fmt(bfd*, int)’:
 /home/pedro/gdb/mygit/src/gdb/../bfd/libhppa.h:380:42: error: invalid conversion from ‘int’ to ‘hppa_opcode_type’ [-fpermissive]
  #define get_opcode(insn) (((insn) >> 26) & 0x3f)
   ^
 /home/pedro/gdb/mygit/src/gdb/../bfd/libhppa.h:465:30: note: in expansion of macro ‘get_opcode’
    enum hppa_opcode_type op = get_opcode (insn);
       ^

bfd/ChangeLog:
2015-10-29  Pedro Alves  <palves@redhat.com>

* libhppa.h (bfd_hppa_insn2fmt): Add cast.

bfd/ChangeLog
bfd/libhppa.h

index e124aa61f13f27d2496858a1566d8eee3cb83c36..cedceadecb7861a642c6529258f1b3dc1dcb37ef 100644 (file)
@@ -1,3 +1,7 @@
+2015-10-29  Pedro Alves  <palves@redhat.com>
+
+       * libhppa.h (bfd_hppa_insn2fmt): Add cast.
+
 2015-10-28  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elf32-i386.c (elf_i386_relocate_section): Fix a typo in
index 9832ccd383e628f858428ab0aa40e9f2c5d647e7..4786f357a01cbfc8ae0d9ab5594700d6786d5d5e 100644 (file)
@@ -462,7 +462,7 @@ enum hppa_opcode_type
 static inline int
 bfd_hppa_insn2fmt (bfd *abfd, int insn)
 {
-  enum hppa_opcode_type op = get_opcode (insn);
+  enum hppa_opcode_type op = (enum hppa_opcode_type) get_opcode (insn);
 
   switch (op)
     {
This page took 0.029915 seconds and 4 git commands to generate.