]> granicus.if.org Git - graphviz/commit
smyrna object_color: rephrase to make initialization of 'vis' more obvious
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 10 Sep 2021 04:24:36 +0000 (21:24 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 16 Sep 2021 04:31:00 +0000 (21:31 -0700)
commit67773f081a4724390e58229ab45e680fff3fcd14
tree66dc30f7c05736338191162013dc88db96c1c372
parentaae6a4aad7319d9e1d686e9b76a17aa1254e44df
smyrna object_color: rephrase to make initialization of 'vis' more obvious

Auditing all call sites of this function reveals it is only ever called with
edges and nodes. But the compiler could not see enough to know this. On macOS,
Clang dutifully warns:

  topviewfuncs.c:165:13: warning: variable 'vis' is used uninitialized whenever
    'if' condition is false [-Wsometimes-uninitialized]

as noted by Stephen.¹

¹ https://forum.graphviz.org/t/tracking-down-warnings-old-news-to-some-of-you/821
cmd/smyrna/topviewfuncs.c