From: Matthew Fernandez Date: Sun, 28 Aug 2022 03:18:07 +0000 (-0700) Subject: gvpr: more tightly scope 'nextg' X-Git-Tag: 6.0.1~16^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=11453c5fef652abfb751c6ee43b70b00b3efe6db;p=graphviz gvpr: more tightly scope 'nextg' This squashes a -Wclobbered compiler warning. Though, as discussed in the prior commit, I believe this to be a false positive. As of this commit, Graphviz builds free of -Wclobbered warnings. Gitlab: closes #1801 --- diff --git a/lib/gvpr/gvpr.c b/lib/gvpr/gvpr.c index 8cdec77e8..6a1df2a50 100644 --- a/lib/gvpr/gvpr.c +++ b/lib/gvpr/gvpr.c @@ -936,7 +936,6 @@ static int gvpr_core(int argc, char *argv[], gvpropts *uopts, gpr_info info; int rv = 0; int cleanup, i, incoreGraphs; - Agraph_t* nextg = NULL; setErrorErrors (0); ingDisc.dflt = sfstdin; @@ -1012,6 +1011,7 @@ static int gvpr_core(int argc, char *argv[], gvpropts *uopts, gs->ing = newIng(0, gs->opts.inFiles, &ingDisc); if (gs->opts.verbose) gvstart_timer (); + Agraph_t* nextg = NULL; for (gs->state->curgraph = nextGraph(gs->ing); gs->state->curgraph; gs->state->curgraph = nextg) { if (gs->opts.verbose) fprintf(stderr, "Read graph: %.2f secs.\n", gvelapsed_sec());