This is the mail archive of the binutils@sources.redhat.com 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]: Add format attributes and fix exposed bugs


Hi,

This patch adds format attributes as revealed by compiling snapshot
binutils-050615 using -Wmissing-format-attribute plus functions found
via selective manual grep.  I also fix the subsequently exposed bugs.

For testing I ran native builds with "make check" for:

x86_64-unknown-linux-gnu
i686-unknown-linux-gnu

To test the target specific files I touched, I also cross-configured
and built for:

xtensa-unknown-elf
tic30-unknown-aout
ia64-unknown-linux-gnu
or32-unknown-rtems
alpha-dec-vms (libbfd.a only, it died later)
i386-unknown-cygwin (to make dlltool/dllwrap)

I strongly suspect that the format attribute on fprintf_ftype will
expose bugs on other (all?) targets, but I can't track them all down
myself.  Apologies in advance to those building with -Werror...

If this is acceptable, I'd appreciate if someone would install since I
don't have write access.

		Thanks,
		--Kaveh


2005-06-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

bfd:
	* elf32-xtensa.c (vsprint_msg): Add format attribute.  Fix
	format bugs.
	* vms.h (_bfd_vms_debug): Add format attribute.
	(_bfd_vms_debug, _bfd_hexdump): Fix typos.
	
binutils:
	* bucomm.h (report): Add format attribute.
	* dlltool.c (inform): Likewise.
	* dllwrap.c (display, inform, warn): Likewise.
	* objdump.c (objdump_sprintf): Likewise.
	* readelf.c (error, warn): Likewise.  Fix format bugs.

gas:
	* config/tc-tic30.c (debug): Add format attribute.  Fix format
	bugs.

include:
	* dis-asm.h (fprintf_ftype): Add format attribute.

opcodes:
	* ia64-dis.c: Fix format bugs.
	* ia64-gen.c (fail, warn): Add format attribute.
	bugs.
	* or32-opc.c (debug): Likewise.
	* or32-dis.c (print_insn): Fix format bugs.

diff -rup orig/binutils-050615/bfd/elf32-xtensa.c binutils-050615/bfd/elf32-xtensa.c
--- orig/binutils-050615/bfd/elf32-xtensa.c	2005-05-20 15:53:18.000000000 -0400
+++ binutils-050615/bfd/elf32-xtensa.c	2005-06-16 09:56:44.000000000 -0400
@@ -1775,7 +1775,7 @@ elf_xtensa_do_reloc (reloc_howto_type *h
 }
 
 
-static char *
+static char * ATTRIBUTE_PRINTF(2,4)
 vsprint_msg (const char *origmsg, const char *fmt, int arglen, ...)
 {
   /* To reduce the size of the memory leak,
@@ -2353,7 +2353,7 @@ elf_xtensa_relocate_section (bfd *output
 		error_message = vsprint_msg (error_message, ": %s",
 					     strlen (name) + 2, name);
 	      else
-		error_message = vsprint_msg (error_message, ": (%s+0x%x)",
+		error_message = vsprint_msg (error_message, ": (%s+0x%lx)",
 					     strlen (name) + 22,
 					     name, rel->r_addend);
 	    }
diff -rup orig/binutils-050615/bfd/vms.h binutils-050615/bfd/vms.h
--- orig/binutils-050615/bfd/vms.h	2005-05-04 11:53:41.000000000 -0400
+++ binutils-050615/bfd/vms.h	2005-06-16 10:07:52.000000000 -0400
@@ -620,8 +620,8 @@ struct vms_private_data_struct		 
 #define SECTION_NAME_TEMPLATE "__SEC__%d"
 					 
 #if VMS_DEBUG				 
-extern void _bfd_vms_debug (int, char *, ..);
-extern void _bfd_hexdump   (int, unsignedchar *, int, int);
+extern void _bfd_vms_debug (int, char *, ...) ATTRIBUTE_PRINTF_2;
+extern void _bfd_hexdump   (int, unsigned char *, int, int);
 					 
 #define vms_debug _bfd_vms_debug	 
 #endif					 
diff -rup orig/binutils-050615/binutils/bucomm.h binutils-050615/binutils/bucomm.h
--- orig/binutils-050615/binutils/bucomm.h	2005-06-14 09:26:42.000000000 -0400
+++ binutils-050615/binutils/bucomm.h	2005-06-16 09:56:44.000000000 -0400
@@ -159,7 +159,7 @@ void bfd_nonfatal (const char *);
 
 void bfd_fatal (const char *) ATTRIBUTE_NORETURN;
 
-void report (const char *, va_list);
+void report (const char *, va_list) ATTRIBUTE_PRINTF(1,0);
 
 void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
 
diff -rup orig/binutils-050615/binutils/dlltool.c binutils-050615/binutils/dlltool.c
--- orig/binutils-050615/binutils/dlltool.c	2005-05-08 10:17:38.000000000 -0400
+++ binutils-050615/binutils/dlltool.c	2005-06-16 09:56:44.000000000 -0400
@@ -708,7 +708,7 @@ static void fill_ordinals (export_type *
 static int alphafunc (const void *, const void *);
 static void mangle_defs (void);
 static void usage (FILE *, int);
-static void inform (const char *, ...);
+static void inform (const char *, ...) ATTRIBUTE_PRINTF_1;
 static void set_dll_name_from_def (const char *);
 
 static char *
diff -rup orig/binutils-050615/binutils/dllwrap.c binutils-050615/binutils/dllwrap.c
--- orig/binutils-050615/binutils/dllwrap.c	2005-05-08 10:17:38.000000000 -0400
+++ binutils-050615/binutils/dllwrap.c	2005-06-16 09:56:44.000000000 -0400
@@ -118,9 +118,9 @@ static int run (const char *, char *);
 static char *mybasename (const char *);
 static int strhash (const char *);
 static void usage (FILE *, int);
-static void display (const char *, va_list);
-static void inform (const char *, ...);
-static void warn (const char *, ...);
+static void display (const char *, va_list) ATTRIBUTE_PRINTF(1,0);
+static void inform (const char *, ...) ATTRIBUTE_PRINTF_1;
+static void warn (const char *, ...) ATTRIBUTE_PRINTF_1;
 static char *look_for_prog (const char *, const char *, int);
 static char *deduce_name (const char *);
 static void delete_temp_files (void);
diff -rup orig/binutils-050615/binutils/objdump.c binutils-050615/binutils/objdump.c
--- orig/binutils-050615/binutils/objdump.c	2005-06-09 10:51:41.000000000 -0400
+++ binutils-050615/binutils/objdump.c	2005-06-16 09:56:44.000000000 -0400
@@ -1189,7 +1189,7 @@ typedef struct
 
 /* sprintf to a "stream".  */
 
-static int
+static int ATTRIBUTE_PRINTF_2
 objdump_sprintf (SFILE *f, const char *format, ...)
 {
   size_t n;
diff -rup orig/binutils-050615/binutils/readelf.c binutils-050615/binutils/readelf.c
--- orig/binutils-050615/binutils/readelf.c	2005-06-14 07:06:28.000000000 -0400
+++ binutils-050615/binutils/readelf.c	2005-06-16 09:56:44.000000000 -0400
@@ -264,7 +264,7 @@ static void (*byte_put) (unsigned char *
 #define streq(a,b)	(strcmp ((a), (b)) == 0)
 #define strneq(a,b,n)	(strncmp ((a), (b), (n)) == 0)
 
-static void
+static void ATTRIBUTE_PRINTF_1
 error (const char *message, ...)
 {
   va_list args;
@@ -275,7 +275,7 @@ error (const char *message, ...)
   va_end (args);
 }
 
-static void
+static void ATTRIBUTE_PRINTF_1
 warn (const char *message, ...)
 {
   va_list args;
@@ -327,7 +327,7 @@ get_data (void *var, FILE *file, long of
 
   if (fseek (file, archive_file_offset + offset, SEEK_SET))
     {
-      error (_("Unable to seek to 0x%x for %s\n"),
+      error (_("Unable to seek to 0x%lx for %s\n"),
 	     archive_file_offset + offset, reason);
       return NULL;
     }
@@ -342,8 +342,8 @@ get_data (void *var, FILE *file, long of
 
       if (mvar == NULL)
 	{
-	  error (_("Out of memory allocating 0x%x bytes for %s\n"),
-		 size * nmemb, reason);
+	  error (_("Out of memory allocating 0x%lx bytes for %s\n"),
+		 (unsigned long)(size * nmemb), reason);
 	  return NULL;
 	}
 
@@ -352,7 +352,8 @@ get_data (void *var, FILE *file, long of
 
   if (fread (mvar, size, nmemb, file) != nmemb)
     {
-      error (_("Unable to read in 0x%x bytes of %s\n"), size * nmemb, reason);
+      error (_("Unable to read in 0x%lx bytes of %s\n"),
+	     (unsigned long)(size * nmemb), reason);
       if (mvar != var)
 	free (mvar);
       return NULL;
@@ -7424,7 +7425,7 @@ fetch_indirect_string (unsigned long off
 
   if (offset > debug_str_size)
     {
-      warn (_("DW_FORM_strp offset too big: %x\n"), offset);
+      warn (_("DW_FORM_strp offset too big: %lx\n"), offset);
       return _("<offset is too big>");
     }
 
@@ -8435,7 +8436,7 @@ read_and_display_attr_value (unsigned lo
       break;
 
     default:
-      warn (_("Unrecognized form: %d\n"), form);
+      warn (_("Unrecognized form: %lu\n"), form);
       break;
     }
 
@@ -9770,10 +9771,10 @@ display_debug_loc (Elf_Internal_Shdr *se
 	    {
 	      if (start < next)
 		warn (_("There is a hole [0x%lx - 0x%lx] in .debug_loc section.\n"),
-		      start - section_begin, next - section_begin);
+		      (long)(start - section_begin), (long)(next - section_begin));
 	      else if (start > next)
 		warn (_("There is an overlap [0x%lx - 0x%lx] in .debug_loc section.\n"),
-		      start - section_begin, next - section_begin);
+		      (long)(start - section_begin), (long)(next - section_begin));
 	    }
 	  start = next;
 
@@ -10123,10 +10124,10 @@ display_debug_ranges (Elf_Internal_Shdr 
 	    {
 	      if (start < next)
 		warn (_("There is a hole [0x%lx - 0x%lx] in .debug_ranges section.\n"),
-		      start - section_begin, next - section_begin);
+		      (long)(start - section_begin), (long)(next - section_begin));
 	      else if (start > next)
 		warn (_("There is an overlap [0x%lx - 0x%lx] in .debug_ranges section.\n"),
-		      start - section_begin, next - section_begin);
+		      (long)(start - section_begin), (long)(next - section_begin));
 	    }
 	  start = next;
 
@@ -10499,7 +10500,7 @@ display_debug_frames (Elf_Internal_Shdr 
 
 	  if (!cie)
 	    {
-	      warn ("Invalid CIE pointer %08lx in FDE at %08lx\n",
+	      warn ("Invalid CIE pointer %08lx in FDE at %p\n",
 		    cie_id, saved_start);
 	      start = block_end;
 	      fc->ncols = 0;
@@ -11785,9 +11786,9 @@ process_corefile_note_segment (FILE *fil
 
       if (((char *) next) > (((char *) pnotes) + length))
 	{
-	  warn (_("corrupt note found at offset %x into core notes\n"),
-		((char *) external) - ((char *) pnotes));
-	  warn (_(" type: %x, namesize: %08lx, descsize: %08lx\n"),
+	  warn (_("corrupt note found at offset %lx into core notes\n"),
+		(long)((char *)external - (char *)pnotes));
+	  warn (_(" type: %lx, namesize: %08lx, descsize: %08lx\n"),
 		inote.type, inote.namesz, inote.descsz);
 	  break;
 	}
@@ -12266,7 +12267,7 @@ process_archive (char *file_name, FILE *
 	  off = strtoul (arhdr.ar_name + 1, NULL, 10);
 	  if (off >= longnames_size)
 	    {
-	      error (_("%s: invalid archive string table offset %lu\n"), off);
+	      error (_("%s: invalid archive string table offset %lu\n"), file_name, off);
 	      ret = 1;
 	      break;
 	    }
@@ -12282,7 +12283,7 @@ process_archive (char *file_name, FILE *
 
       if (nameend == NULL)
 	{
-	  error (_("%s: bad archive file name\n"));
+	  error (_("%s: bad archive file name\n"), file_name);
 	  ret = 1;
 	  break;
 	}
diff -rup orig/binutils-050615/gas/config/tc-tic30.c binutils-050615/gas/config/tc-tic30.c
--- orig/binutils-050615/gas/config/tc-tic30.c	2005-06-07 13:54:18.000000000 -0400
+++ binutils-050615/gas/config/tc-tic30.c	2005-06-16 09:56:44.000000000 -0400
@@ -86,7 +86,7 @@ const pseudo_typeS md_pseudo_table[] =
   {0, 0, 0}
 };
 
-static int
+static int ATTRIBUTE_PRINTF_1
 debug (const char *string, ...)
 {
   if (flag_debug)
@@ -439,9 +439,9 @@ tic30_operand (char *token)
 
 	  debug ("Expression type: %d\n",
 		 current_op->direct.direct_expr.X_op);
-	  debug ("Expression addnum: %d\n",
-		 current_op->direct.direct_expr.X_add_number);
-	  debug ("Segment: %d\n", retval);
+	  debug ("Expression addnum: %ld\n",
+		 (long) current_op->direct.direct_expr.X_add_number);
+	  debug ("Segment: %p\n", retval);
 
 	  input_line_pointer = save_input_line_pointer;
 
@@ -609,9 +609,9 @@ tic30_operand (char *token)
 	      retval = expression (&current_op->immediate.imm_expr);
 	      debug ("Expression type: %d\n",
 		     current_op->immediate.imm_expr.X_op);
-	      debug ("Expression addnum: %d\n",
-		     current_op->immediate.imm_expr.X_add_number);
-	      debug ("Segment: %d\n", retval);
+	      debug ("Expression addnum: %ld\n",
+		     (long) current_op->immediate.imm_expr.X_add_number);
+	      debug ("Segment: %p\n", retval);
 	      input_line_pointer = save_input_line_pointer;
 
 	      if (current_op->immediate.imm_expr.X_op == O_constant)
@@ -1140,7 +1140,7 @@ md_apply_fix (fixS *fixP,
   debug ("Values in fixP\n");
   debug ("fx_size = %d\n", fixP->fx_size);
   debug ("fx_pcrel = %d\n", fixP->fx_pcrel);
-  debug ("fx_where = %d\n", fixP->fx_where);
+  debug ("fx_where = %ld\n", fixP->fx_where);
   debug ("fx_offset = %d\n", (int) fixP->fx_offset);
   {
     char *buf = fixP->fx_frag->fr_literal + fixP->fx_where;
@@ -1182,11 +1182,11 @@ md_undefined_symbol (char *name ATTRIBUT
 valueT
 md_section_align (segT segment, valueT size)
 {
-  debug ("In md_section_align() segment = %d and size = %d\n",
-	 segment, size);
+  debug ("In md_section_align() segment = %p and size = %lu\n",
+	 segment, (unsigned long) size);
   size = (size + 3) / 4;
   size *= 4;
-  debug ("New size value = %d\n", size);
+  debug ("New size value = %lu\n", (unsigned long) size);
   return size;
 }
 
@@ -1196,7 +1196,7 @@ md_pcrel_from (fixS *fixP)
   int offset;
 
   debug ("In md_pcrel_from()\n");
-  debug ("fx_where = %d\n", fixP->fx_where);
+  debug ("fx_where = %ld\n", fixP->fx_where);
   debug ("fx_size = %d\n", fixP->fx_size);
   /* Find the opcode that represents the current instruction in the
      fr_literal storage area, and check bit 21.  Bit 21 contains whether the
diff -rup orig/binutils-050615/include/dis-asm.h binutils-050615/include/dis-asm.h
--- orig/binutils-050615/include/dis-asm.h	2005-06-08 13:27:41.000000000 -0400
+++ binutils-050615/include/dis-asm.h	2005-06-16 09:56:44.000000000 -0400
@@ -35,7 +35,7 @@ extern "C" {
 #include <stdio.h>
 #include "bfd.h"
 
-typedef int (*fprintf_ftype) (void *, const char*, ...);
+typedef int (*fprintf_ftype) (void *, const char*, ...) ATTRIBUTE_FPTR_PRINTF_2;
 
 enum dis_insn_type {
   dis_noninsn,			/* Not a valid instruction */
diff -rup orig/binutils-050615/opcodes/ia64-dis.c binutils-050615/opcodes/ia64-dis.c
--- orig/binutils-050615/opcodes/ia64-dis.c	2005-05-07 03:34:28.000000000 -0400
+++ binutils-050615/opcodes/ia64-dis.c	2005-06-16 09:56:44.000000000 -0400
@@ -109,7 +109,7 @@ print_insn_ia64 (bfd_vma memaddr, struct
   if (slotnum == 0)
     (*info->fprintf_func) (info->stream, "[%s] ", tname);
   else
-    (*info->fprintf_func) (info->stream, "      ", tname);
+    (*info->fprintf_func) (info->stream, "      ");
 
   unit = ia64_templ_desc[template].exec_unit[slotnum];
 
@@ -237,11 +237,11 @@ print_insn_ia64 (bfd_vma memaddr, struct
 	    if (str)
 	      (*info->fprintf_func) (info->stream, "%s", str);
 	    else if (odesc->flags & IA64_OPND_FLAG_DECIMAL_SIGNED)
-	      (*info->fprintf_func) (info->stream, "%lld", value);
+	      (*info->fprintf_func) (info->stream, "%lld", (long long) value);
 	    else if (odesc->flags & IA64_OPND_FLAG_DECIMAL_UNSIGNED)
-	      (*info->fprintf_func) (info->stream, "%llu", value);
+	      (*info->fprintf_func) (info->stream, "%llu", (long long) value);
 	    else
-	      (*info->fprintf_func) (info->stream, "0x%llx", value);
+	      (*info->fprintf_func) (info->stream, "0x%llx", (long long) value);
 	    break;
 
 	  case IA64_OPND_CLASS_REL:
@@ -268,6 +268,6 @@ print_insn_ia64 (bfd_vma memaddr, struct
   return retval;
 
  decoding_failed:
-  (*info->fprintf_func) (info->stream, "      data8 %#011llx", insn);
+  (*info->fprintf_func) (info->stream, "      data8 %#011llx", (long long) insn);
   goto failed;
 }
diff -rup orig/binutils-050615/opcodes/ia64-gen.c binutils-050615/opcodes/ia64-gen.c
--- orig/binutils-050615/opcodes/ia64-gen.c	2005-05-07 03:34:28.000000000 -0400
+++ binutils-050615/opcodes/ia64-gen.c	2005-06-16 09:56:44.000000000 -0400
@@ -239,8 +239,8 @@ static int dlistlen = 0;
 static int dlisttotlen = 0;
 
 
-static void fail (const char *, ...);
-static void warn (const char *, ...);
+static void fail (const char *, ...) ATTRIBUTE_PRINTF_1;
+static void warn (const char *, ...) ATTRIBUTE_PRINTF_1;
 static struct rdep * insert_resource (const char *, enum ia64_dependency_mode);
 static int  deplist_equals (struct deplist *, struct deplist *);
 static short insert_deplist (int, unsigned short *);
diff -rup orig/binutils-050615/opcodes/or32-dis.c binutils-050615/opcodes/or32-dis.c
--- orig/binutils-050615/opcodes/or32-dis.c	2005-05-07 03:34:30.000000000 -0400
+++ binutils-050615/opcodes/or32-dis.c	2005-06-16 09:56:44.000000000 -0400
@@ -321,7 +321,7 @@ print_insn (memaddr, info)
 
   /* This used to be %8x for binutils.  */
   (*info->fprintf_func)
-    (info->stream, ".word 0x%08x", insn);
+    (info->stream, ".word 0x%08lx", insn);
   return 4;
 }
 
diff -rup orig/binutils-050615/opcodes/or32-opc.c binutils-050615/opcodes/or32-opc.c
--- orig/binutils-050615/opcodes/or32-opc.c	2005-05-07 03:34:30.000000000 -0400
+++ binutils-050615/opcodes/or32-opc.c	2005-06-16 09:56:44.000000000 -0400
@@ -342,9 +342,7 @@ const struct or32_opcode or32_opcodes[] 
 /* Define dummy, if debug is not defined.  */
 
 #if !defined HAS_DEBUG
-static void debug PARAMS ((int, const char *, ...));
-
-static void
+static void ATTRIBUTE_PRINTF_2
 debug (int level ATTRIBUTE_UNUSED, const char *format ATTRIBUTE_UNUSED, ...)
 {
 }
@@ -520,7 +518,7 @@ cover_insn (cur, pass, mask)
 	last_match = i;
       }
   
-  debug (8, "%08X %08X\n", mask, cur_mask);
+  debug (8, "%08X %08lX\n", mask, cur_mask);
 
   if (ninstr == 0)
     return 0;
@@ -528,8 +526,8 @@ cover_insn (cur, pass, mask)
   if (ninstr == 1)
     {
       /* Leaf holds instruction index.  */
-      debug (8, "%i>I%i %s\n",
-	     cur - automata, last_match, or32_opcodes[last_match].name);
+      debug (8, "%li>I%i %s\n",
+	     (long)(cur - automata), last_match, or32_opcodes[last_match].name);
 
       *cur = LEAF_FLAG | last_match;
       cur++;
@@ -546,7 +544,7 @@ cover_insn (cur, pass, mask)
 	    {
 	      unsigned long m = (1UL << ((unsigned long)len)) - 1;
 
-	      debug (9, " (%i(%08X & %08X>>%i = %08X, %08X)",
+	      debug (9, " (%i(%08lX & %08lX>>%i = %08lX, %08lX)",
 		     len,m, cur_mask, i, (cur_mask >> (unsigned)i),
 		     (cur_mask >> (unsigned)i) & m);
 
@@ -575,8 +573,8 @@ cover_insn (cur, pass, mask)
 	  exit (1);
 	}
 
-      debug (8, "%i> #### %i << %i (%i) ####\n",
-	     cur - automata, best_len, best_first, ninstr);
+      debug (8, "%li> #### %i << %i (%i) ####\n",
+	     (long)(cur - automata), best_len, best_first, ninstr);
 
       *cur = best_first;
       cur++;
@@ -600,17 +598,17 @@ cover_insn (cur, pass, mask)
 		&& ((ti[j].insn_mask >> best_first) & cur_mask) == cur_mask)
 	      ti[j].in_pass = curpass;
 
-	  debug (9, "%08X %08X %i\n", mask, cur_mask, best_first);
+	  debug (9, "%08X %08lX %i\n", mask, cur_mask, best_first);
 	  c = cover_insn (cur, curpass, mask & (~(cur_mask << best_first)));
 	  if (c)
 	    {
-	      debug (8, "%i> #%X -> %u\n", next - automata, i, cur - automata);
+	      debug (8, "%li> #%X -> %lu\n", (long)(next - automata), i, (long)(cur - automata));
 	      *next = cur - automata;
 	      cur = c;	 
 	    }
 	  else 
 	    {
-	      debug (8, "%i> N/A\n", next - automata);
+	      debug (8, "%li> N/A\n", (long)(next - automata));
 	      *next = 0;
 	    }
 	  next++;
@@ -655,7 +653,7 @@ parse_params (opcode, cur)
     {
       cur->type = OPTYPE_REG | OPTYPE_OP | OPTYPE_LAST;
       cur->data = 0;
-      debug (9, "#%08X %08X\n", cur->type, cur->data);
+      debug (9, "#%08lX %08lX\n", cur->type, cur->data);
       cur++;
       return cur;
   }
@@ -672,7 +670,7 @@ parse_params (opcode, cur)
 	  unsigned long arg;
 
 	  arg = insn_extract (*args, opcode->encoding);
-	  debug (9, "%s : %08X ------\n", opcode->name, arg);
+	  debug (9, "%s : %08lX ------\n", opcode->name, arg);
 	  if (letter_signed (*args))
 	    {
 	      type |= OPTYPE_SIG;
@@ -698,7 +696,7 @@ parse_params (opcode, cur)
 	      cur->type = type | shr;
 	      cur->data = mask;
 	      arg &= ~(((1 << mask) - 1) << shr);
-	      debug (6, "|%08X %08X\n", cur->type, cur->data);
+	      debug (6, "|%08lX %08lX\n", cur->type, cur->data);
 	      cur++;
 	    }
 	  args++;
@@ -708,7 +706,7 @@ parse_params (opcode, cur)
 	  /* Next param is displacement.  Later we will treat them as one operand.  */
 	  cur--;
 	  cur->type = type | cur->type | OPTYPE_DIS | OPTYPE_OP;
-	  debug (9, ">%08X %08X\n", cur->type, cur->data);
+	  debug (9, ">%08lX %08lX\n", cur->type, cur->data);
 	  cur++;
 	  type = 0;
 	  i++;
@@ -718,7 +716,7 @@ parse_params (opcode, cur)
 	{
 	  cur--;
 	  cur->type = type | cur->type | OPTYPE_OP;
-	  debug (9, ">%08X %08X\n", cur->type, cur->data);
+	  debug (9, ">%08lX %08lX\n", cur->type, cur->data);
 	  cur++;
 	  type = 0;
 	  i++;
@@ -728,7 +726,7 @@ parse_params (opcode, cur)
 	{
 	  cur->type = type;
 	  cur->data = 0;
-	  debug (9, ">%08X %08X\n", cur->type, cur->data);
+	  debug (9, ">%08lX %08lX\n", cur->type, cur->data);
 	  cur++;
 	  type = 0;
 	  i++;
@@ -745,7 +743,7 @@ parse_params (opcode, cur)
 
   cur--;
   cur->type = type | cur->type | OPTYPE_OP | OPTYPE_LAST;
-  debug (9, "#%08X %08X\n", cur->type, cur->data);
+  debug (9, "#%08lX %08lX\n", cur->type, cur->data);
   cur++;
 
   return cur;
@@ -834,7 +832,7 @@ insn_decode (insn)
     {
       unsigned int first = *a;
 
-      debug (9, "%i ", a - automata);
+      debug (9, "%li ", (long)(a - automata));
 
       a++;
       i = (insn >> first) & *a;
@@ -842,7 +840,7 @@ insn_decode (insn)
       if (!*(a + i))
 	{
 	  /* Invalid instruction found?  */
-	  debug (9, "XXX\n", i);
+	  debug (9, "XXX\n");
 	  return -1;
 	}
       a = automata + *(a + i);


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