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
g->flds = 0;
}
-static grid *initGrid()
+static grid *initGrid(void)
{
grid *gr = NEW(grid);
gr->columns = NULL;
else
return g;
} else
- g = initGrid(str);
+ g = initGrid();
add_column(g, Name, 0, G_TYPE_STRING);
if (!str)
return g;