This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] bfd/libhppa.h: Make C++ compatible
- From: Pedro Alves <palves at redhat dot com>
- To: binutils at sourceware dot org
- Cc: Simon Marchi <simon dot marchi at polymtl dot ca>
- Date: Wed, 28 Oct 2015 19:09:05 +0000
- Subject: [PATCH] bfd/libhppa.h: Make C++ compatible
- Authentication-results: sourceware.org; auth=none
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?
bfd/ChangeLog:
2015-10-28 Pedro Alves <palves@redhat.com>
* 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)
{
--
1.9.3