From 3dbaf4f33646dc2e0ae9aaa8f4c8570d50a04c27 Mon Sep 17 00:00:00 2001 From: Jacob Garber Date: Tue, 2 Jul 2019 12:39:16 -0600 Subject: util/romcc: Correct format specifiers The right specifier for printing ptrdiff_t is %td. Change-Id: I7bae4d47f15cfe85ca870f687c6f702339f680bb Signed-off-by: Jacob Garber Found-by: Coverity CID 14021{64,68,76} Reviewed-on: https://review.coreboot.org/c/coreboot/+/33984 Tested-by: build bot (Jenkins) Reviewed-by: HAOUAS Elyes Reviewed-by: Paul Menzel Reviewed-by: Patrick Georgi --- util/romcc/romcc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'util/romcc') diff --git a/util/romcc/romcc.c b/util/romcc/romcc.c index 2a158e5fe0..378bfc50f2 100644 --- a/util/romcc/romcc.c +++ b/util/romcc/romcc.c @@ -19873,7 +19873,7 @@ static int color_graph(struct compile_state *state, struct reg_state *rstate) else { return 1; } - cgdebug_printf(state, " %d\n", range - rstate->lr); + cgdebug_printf(state, " %td\n", range - rstate->lr); range->group_prev = 0; for(edge = range->edges; edge; edge = edge->next) { struct live_range *node; @@ -19891,7 +19891,7 @@ static int color_graph(struct compile_state *state, struct reg_state *rstate) if (&node->group_next == rstate->high_tail) { rstate->high_tail = node->group_prev; } - cgdebug_printf(state, "Moving...%d to low\n", node - rstate->lr); + cgdebug_printf(state, "Moving...%td to low\n", node - rstate->lr); node->group_prev = rstate->low_tail; node->group_next = 0; *rstate->low_tail = node; @@ -19904,7 +19904,7 @@ static int color_graph(struct compile_state *state, struct reg_state *rstate) } colored = color_graph(state, rstate); if (colored) { - cgdebug_printf(state, "Coloring %d @", range - rstate->lr); + cgdebug_printf(state, "Coloring %td @", range - rstate->lr); cgdebug_loc(state, range->defs->def); cgdebug_flush(state); colored = select_free_color(state, rstate, range); @@ -20198,7 +20198,7 @@ static void allocate_registers(struct compile_state *state) */ if ((range->degree < regc_max_size(state, range->classes)) || (range->color != REG_UNSET)) { - cgdebug_printf(state, "Lo: %5d degree %5d%s\n", + cgdebug_printf(state, "Lo: %5td degree %5d%s\n", range - rstate.lr, range->degree, (range->color != REG_UNSET) ? " (colored)": ""); *range->group_prev = range->group_next; @@ -20215,7 +20215,7 @@ static void allocate_registers(struct compile_state *state) next = point; } else { - cgdebug_printf(state, "hi: %5d degree %5d%s\n", + cgdebug_printf(state, "hi: %5td degree %5d%s\n", range - rstate.lr, range->degree, (range->color != REG_UNSET) ? " (colored)": ""); } -- cgit v1.2.3