This is the mail archive of the binutils-cvs@sourceware.org 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]

[binutils-gdb] bfd/libhppa.h: Make C++ compatible


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=968bc5cc86bff4ebf89e63bf99db7c7e777d4756

commit 968bc5cc86bff4ebf89e63bf99db7c7e777d4756
Author: Pedro Alves <palves@redhat.com>
Date:   Thu Oct 29 12:55:03 2015 +0000

    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);
    			       ^
    
    bfd/ChangeLog:
    2015-10-29  Pedro Alves  <palves@redhat.com>
    
    	* libhppa.h (bfd_hppa_insn2fmt): Add cast.

Diff:
---
 bfd/ChangeLog | 4 ++++
 bfd/libhppa.h | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index e124aa6..cedcead 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
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]