From 31ef5a3c31214d77137e4b36603a2a97576e851e Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Fri, 8 May 2020 17:16:18 -0700 Subject: [PATCH] fix: print index instead of pointer value in debugging message The .v and .av members of the structs being used here are node_t**s. So the addition of an integer results in a node_t**. This does not seem like what was intended to be printed here, but rather the integer value being added. This issue was found by adding __attribute__((format(printf, 2, 3))) to agerr() and then using compiler flag -Werror=format. --- lib/dotgen/mincross.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dotgen/mincross.c b/lib/dotgen/mincross.c index c7c498541..7d5f73ae9 100644 --- a/lib/dotgen/mincross.c +++ b/lib/dotgen/mincross.c @@ -1365,7 +1365,7 @@ void install_in_rank(graph_t * g, node_t * n) if (GD_rank(g)[r].v + ND_order(n) > GD_rank(g)[r].av + GD_rank(Root)[r].an) { agerr(AGERR, "install_in_rank, line %d: GD_rank(g)[%d].v + ND_order(%s) [%d] > GD_rank(g)[%d].av + GD_rank(Root)[%d].an [%d]\n", - __LINE__, r, agnameof(n),GD_rank(g)[r].v + ND_order(n), r, r, GD_rank(g)[r].av+GD_rank(Root)[r].an); + __LINE__, r, agnameof(n),ND_order(n), r, r, GD_rank(Root)[r].an); return; } } -- 2.40.0