This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] bfd/libhppa.h: Make C++ compatible

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);

OK to apply?

2015-10-28  Pedro Alves  <>

	* libhppa.h (bfd_hppa_insn2fmt): Add cast.
 bfd/libhppa.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bfd/libhppa.h b/bfd/libhppa.h
index 9832ccd..4786f35 100644
--- a/bfd/libhppa.h
+++ b/bfd/libhppa.h
@@ -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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]