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]

Fix warning


The difference between two pointers has type ptrdiff_t and might not be
compatible with int.

Andreas.

2003-02-04  Andreas Schwab  <schwab@suse.de>

	* rddbg.c (read_section_stabs_debugging_info): Cast ptrdiff_t to
	long and use %ld in printf format.

--- binutils/rddbg.c.~1.7.~	2002-12-02 10:59:15.000000000 +0100
+++ binutils/rddbg.c	2003-02-04 14:11:22.000000000 +0100
@@ -193,9 +193,9 @@ read_section_stabs_debugging_info (abfd,
 
 		  if (stroff + strx > strsize)
 		    {
-		      fprintf (stderr, "%s: %s: stab entry %d is corrupt, strx = 0x%x, type = %d\n",
+		      fprintf (stderr, "%s: %s: stab entry %ld is corrupt, strx = 0x%x, type = %d\n",
 			       bfd_get_filename (abfd), names[i].secname,
-			       (stab - stabs) / 12, strx, type);
+			       (long) (stab - stabs) / 12, strx, type);
 		      continue;
 		    }
 

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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