From: Matthew Fernandez Date: Fri, 10 Sep 2021 04:31:02 +0000 (-0700) Subject: smyrna update_columns: fix incorrect call to initGrid X-Git-Tag: 2.49.1~19^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2209620d6a4b52e9be66b8636bdb6fa5ccbab7f9;p=graphviz smyrna update_columns: fix incorrect call to initGrid Thanks to backwards compatibility with K&R C, a function declared with no parameter list takes an unspecified number of parameters. So it is legal to call such a function with any arguments. Nevertheless on macOS Clang notices: tvnodes.c:354:18: warning: too many arguments in call to 'initGrid' as noted by Stephen.¹ This commit both fixes the call and alters `initGrid` to have a more strict signature. This appears to be the correct fix to me as `str` is duped into `g->flds` below this which is what I think the mistaken call to `initGrid` believed was happening inside `initGrid`. ¹ https://forum.graphviz.org/t/tracking-down-warnings-old-news-to-some-of-you/821 --- diff --git a/cmd/smyrna/tvnodes.c b/cmd/smyrna/tvnodes.c index 16428d0c9..79abaf35b 100644 --- a/cmd/smyrna/tvnodes.c +++ b/cmd/smyrna/tvnodes.c @@ -330,7 +330,7 @@ static void clearGrid(grid * g) g->flds = 0; } -static grid *initGrid() +static grid *initGrid(void) { grid *gr = NEW(grid); gr->columns = NULL; @@ -351,7 +351,7 @@ static grid *update_columns(grid * g, char *str) else return g; } else - g = initGrid(str); + g = initGrid(); add_column(g, Name, 0, G_TYPE_STRING); if (!str) return g;