This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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] Quash Wformat warning


Another step towards -Werror.
This silences two -Wformat warnings in pretty much unused code.
Adding casts doesn't strike me as the nicest thing to do here, but
well, it works.  Also the lines are now 80/81 columns long, but
splitting them would make this slightly more ugly, I suspect.

Ok?

2012-08-18  Marek Polacek  <polacek@redhat.com>

	* debug/pcprofiledump.c (main): Add casts to avoid warnings.

--- libc/debug/pcprofiledump.c.mp	2012-08-18 01:12:48.434394935 +0200
+++ libc/debug/pcprofiledump.c	2012-08-18 11:26:18.936765074 +0200
@@ -1,5 +1,5 @@
 /* Dump information generated by PC profiling.
-   Copyright (C) 1999, 2002, 2007, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1999-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
 
@@ -142,8 +142,8 @@ main (int argc, char *argv[])
 	    break;
 
 	  printf ("this = %#010" PRIx32 ", caller = %#010" PRIx32 "\n",
-		  must_swap ? bswap_32 (pair.ptrs[0]) : pair.ptrs[0],
-		  must_swap ? bswap_32 (pair.ptrs[1]) : pair.ptrs[1]);
+		  must_swap ? (uint32_t) bswap_32 (pair.ptrs[0]) : pair.ptrs[0],
+		  must_swap ? (uint32_t) bswap_32 (pair.ptrs[1]) : pair.ptrs[1]);
 	}
     }
   else if (word == 0xdeb00008)
@@ -169,8 +169,8 @@ main (int argc, char *argv[])
 	    break;
 
 	  printf ("this = %#018" PRIx64 ", caller = %#018" PRIx64 "\n",
-		  must_swap ? bswap_64 (pair.ptrs[0]) : pair.ptrs[0],
-		  must_swap ? bswap_64 (pair.ptrs[1]) : pair.ptrs[1]);
+		  must_swap ? (uint64_t) bswap_64 (pair.ptrs[0]) : pair.ptrs[0],
+		  must_swap ? (uint64_t) bswap_64 (pair.ptrs[1]) : pair.ptrs[1]);
 	}
     }
   else

	Marek


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