Squashes a compiler warning:
attr.c: In function ‘init_all_attrs’:
attr.c:534:37: warning: cast between incompatible function types from ‘void
(*)(Agraph_t *)’ {aka ‘void (*)(struct Agraph_s *)’} to ‘void (*)(Agraph_t
*, Agobj_t *, void *)’ {aka ‘void (*)(struct Agraph_s *, struct Agobj_s *,
void *)’} [-Wcast-function-type]
534 | agapply(root, (Agobj_t *) root, (agobjfn_t) agraphattr_init,
| ^
This code was incorrect. But on the most common architecture in contemporary
use, x86-64, the calling convention for both is fully in registers, so no user
visible misbehavior would have been seen.
Gitlab: #2300
return agxset(obj, a, value);
}
+static void agraphattr_init_wrapper(Agraph_t *g, Agobj_t *ignored1,
+ void *ignored2) {
+ (void)ignored1;
+ (void)ignored2;
+
+ agraphattr_init(g);
+}
/*
* attach attributes to the already created graph objs.
Agedge_t *e;
root = agroot(g);
- agapply(root, (Agobj_t *) root, (agobjfn_t) agraphattr_init,
- NULL, TRUE);
+ agapply(root, (Agobj_t*)root, agraphattr_init_wrapper, NULL, TRUE);
for (n = agfstnode(root); n; n = agnxtnode(root, n)) {
agnodeattr_init(g, n);
for (e = agfstout(root, n); e; e = agnxtout(root, e)) {