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

PATCH: Fix ia64 gcc warnings


On Linux/ia64, I got warnings like

/net/gnu-13/export/gnu/src/binutils-import/binutils/opcodes/m68k-dis.c:
In function `print_insn_m68k':
/net/gnu-13/export/gnu/src/binutils-import/binutils/opcodes/m68k-dis.c:1354:
warning: variable 'buffer' might be clobbered by `longjmp' or `vfork'
make[6]: *** [m68k-dis.lo] Error 1 

This patch fixes them.


H.J.
----
2005-11-02  H.J. Lu  <hongjiu.lu@intel.com>

	* h8500-dis.c (print_insn_h8500): Initialize local variables
	after setjmp.
	* m68k-dis.c (print_insn_m68k): Likewise.
	* vax-dis.c (print_insn_vax): Likewise.

--- opcodes/h8500-dis.c.jmp	2005-07-07 13:44:35.000000000 -0700
+++ opcodes/h8500-dis.c	2005-11-02 09:06:05.000000000 -0800
@@ -75,10 +75,10 @@ int
 print_insn_h8500 (bfd_vma addr, disassemble_info *info)
 {
   const h8500_opcode_info *opcode;
-  void *stream = info->stream;
-  fprintf_ftype func = info->fprintf_func;
+  void *stream;
+  fprintf_ftype func;
   struct private priv;
-  bfd_byte *buffer = priv.the_buffer;
+  bfd_byte *buffer;
 
   info->private_data = (PTR) & priv;
   priv.max_fetched = priv.the_buffer;
@@ -87,6 +87,10 @@ print_insn_h8500 (bfd_vma addr, disassem
     /* Error return.  */
     return -1;
 
+  stream = info->stream;
+  func = info->fprintf_func;
+  buffer = priv.the_buffer;
+
   /* Run down the table to find the one which matches.  */
   for (opcode = h8500_table; opcode->name; opcode++)
     {
--- opcodes/m68k-dis.c.jmp	2005-07-06 08:45:35.000000000 -0700
+++ opcodes/m68k-dis.c	2005-11-02 09:03:11.000000000 -0800
@@ -1351,7 +1351,7 @@ print_insn_m68k (bfd_vma memaddr, disass
   const char *d;
   unsigned int arch_mask;
   struct private priv;
-  bfd_byte *buffer = priv.the_buffer;
+  bfd_byte *buffer;
   int major_opcode;
   static int numopcodes[16];
   static const struct m68k_opcode **opcodes[16];
@@ -1396,6 +1396,8 @@ print_insn_m68k (bfd_vma memaddr, disass
     /* Error return.  */
     return -1;
 
+  buffer = priv.the_buffer;
+
   switch (info->mach)
     {
     default:
--- opcodes/vax-dis.c.jmp	2005-07-06 08:45:35.000000000 -0700
+++ opcodes/vax-dis.c	2005-11-02 09:06:44.000000000 -0800
@@ -360,7 +360,7 @@ print_insn_vax (bfd_vma memaddr, disasse
   const char *argp;
   unsigned char *arg;
   struct private priv;
-  bfd_byte *buffer = priv.the_buffer;
+  bfd_byte *buffer;
 
   info->private_data = & priv;
   priv.max_fetched = priv.the_buffer;
@@ -379,6 +379,8 @@ print_insn_vax (bfd_vma memaddr, disasse
     /* Error return.  */
     return -1;
 
+  buffer = priv.the_buffer;
+
   argp = NULL;
   /* Check if the info buffer has more than one byte left since
      the last opcode might be a single byte with no argument data.  */


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