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
* Contributors: Details at https://graphviz.org
*************************************************************************/
+#include <assert.h>
#include "topviewfuncs.h"
#include <cgraph/cgraph.h>
#include "smyrna_utils.h"
Alpha=getAttrFloat(g,objg,"defaultedgealpha",1);
vis = GE_visible (objg);
}
- else if(objType==AGNODE) {
+ else {
+ assert(objType == AGNODE);
Alpha=getAttrFloat(g,objg,"defaultnodealpha",1);
vis = GN_visible (objg);
}