Skip to contentSkip to conversation

builtin/pack-objects.c: Fix a printf format compiler warning

PATCH In review Ramsay Jones 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 builtin/pack-objects.c: Fix a printf format compiler warning

In particular, on systems that define uint32_t as an unsigned long, gcc complains as follows:

CC builtin/pack-objects.o
pack-objects.c: In function `compute_write_order':
pack-objects.c:600: warning: unsigned int format, uint32_t arg (arg 3)

In order to suppress the warning, we use the C99 format specifier macro PRIu32.

---

Hi Dan,

If you need to re-roll your pack-objects series (dm/pack-objects-update branch in pu), could you please squash this change into your final commit 0a8145bd (pack-objects: don't traverse objects unnecessarily, 18-10-2011).

If you don't need to re-roll, then I'm hoping Junio will notice and squash this in before it hits next. ;-)

ATB,
Ramsay Jones

 builtin/pack-objects.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
builtin/pack-objects.c +1 -1
index 6db45fa..4bbd815 100644
@@ -597,7 +597,7 @@ static struct object_entry **compute_write_order(void)
 	}
 
 	if (wo_end != nr_objects)
-		die("ordered %u objects, expected %u", wo_end, nr_objects);
+		die("ordered %u objects, expected %"PRIu32, wo_end, nr_objects);
 
 	return wo;
 }
Signature · 1 line
1.7.7
#1 lore raw
Quoted 2 lines · Ramsay Jones

If you don't need to re-roll, then I'm hoping Junio will notice and squash this in before it hits next. ;-)

Will do; thanks, both.

#2 lore raw
In reply to Ramsay Jones
Quoted 14 lines · Ramsay Jones

In particular, on systems that define uint32_t as an unsigned long, gcc complains as follows:

       CC builtin/pack-objects.o
   pack-objects.c: In function `compute_write_order':
   pack-objects.c:600: warning: unsigned int format, uint32_t arg (arg 3)

In order to suppress the warning, we use the C99 format specifier macro PRIu32.

---

Quoted 8 lines

Hi Dan,

If you need to re-roll your pack-objects series (dm/pack-objects-update branch in pu), could you please squash this change into your final commit 0a8145bd (pack-objects: don't traverse objects unnecessarily, 18-10-2011).

If you don't need to re-roll, then I'm hoping Junio will notice and squash this in before it hits next. ;-)

Sorry about that- fixed locally, and if I do need to resend them then it will be fixed.

-Dan