]> granicus.if.org Git - graphviz/commit
smyrna update_columns: fix incorrect call to initGrid
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 10 Sep 2021 04:31:02 +0000 (21:31 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 16 Sep 2021 04:31:00 +0000 (21:31 -0700)
commit2209620d6a4b52e9be66b8636bdb6fa5ccbab7f9
tree1712322b3171dfe8b7c6f9b31d3b2909d27915be
parent0a6d48afe61e194d9db81768bf9804e7ae725934
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
cmd/smyrna/tvnodes.c