public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [committed] Fix Wformat warnings in htab_report with CC="gcc -m32"
@ 2019-01-01  0:00 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2019-01-01  0:00 UTC (permalink / raw)
  To: dwz, jakub

Hi,

Using:
...
$ make CC="gcc -m32"
...
we run into this warning:
...
gcc -m32 -O2 -Wall -W -D_FILE_OFFSET_BITS=64 -DDWZ_VERSION='"0.13"' \
  -DFSF_YEARS='"1992-2019"' -DRH_YEARS='"2001-2018"' -DSUSE_YEARS='"2019"' \
  -c -o dwz.o /data/dwz/dwz.git/dwz.c
dwz.c: In function 'htab_report':
dwz.c:1256:37: warning: format '%lu' expects argument of type \
  'long unsigned int', but argument 3 has type 'size_t {aka unsigned int}' \
  [-Wformat=]
     fprintf (stderr, "      size: %lu\n", size);
                                   ~~^
                                   %u
...

Fix this and similar in htab_report by using %zu instead.

Committed to trunk.

Thanks,
- Tom

Fix Wformat warnings in htab_report with CC="gcc -m32"

2019-11-27  Tom de Vries  <tdevries@suse.de>

	* dwz.c (htab_report): Fix Wformat warnings.

---
 dwz.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dwz.c b/dwz.c
index 36b54d8..e26b02e 100644
--- a/dwz.c
+++ b/dwz.c
@@ -1253,15 +1253,15 @@ htab_report (htab_t htab, const char *msg)
   if (1)
     fprintf (stderr, "htab: %s\n", msg);
   if (1)
-    fprintf (stderr, "      size: %lu\n", size);
+    fprintf (stderr, "      size: %zu\n", size);
   if (elements > 0 && deleted == 0)
-    fprintf (stderr, "      elements: %lu, occupancy: %f\n", elements,
+    fprintf (stderr, "      elements: %zu, occupancy: %f\n", elements,
 	     occupancy);
   if (deleted > 0)
-    fprintf (stderr, "      elements (incl. deleted): %lu, occupancy: %f\n",
+    fprintf (stderr, "      elements (incl. deleted): %zu, occupancy: %f\n",
 	     elements, occupancy);
   if (deleted > 0)
-    fprintf (stderr, "      elements (excl. deleted): %lu, occupancy: %f\n",
+    fprintf (stderr, "      elements (excl. deleted): %zu, occupancy: %f\n",
 	     adjusted_elements, adjusted_occupancy);
   if (elements > 0)
     fprintf (stderr, "      searches: %u, collisions: %f\n", searches,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-27 18:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [committed] Fix Wformat warnings in htab_report with CC="gcc -m32" Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).