*: use void * for printing pointers
On higher warning levels, compilers expect %p printf arguments to be
void *. Since format string / argument warnings can be useful
otherwise, let's get rid of this noise by sprinkling casts to void *
over printf calls.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c
index cfa9bc1..191a9e7 100644
--- a/bgpd/bgp_aspath.c
+++ b/bgpd/bgp_aspath.c
@@ -1913,7 +1913,7 @@
as = (struct aspath *) backet->data;
- vty_out (vty, "[%p:%u] (%ld) ", backet, backet->key, as->refcnt);
+ vty_out (vty, "[%p:%u] (%ld) ", (void *)backet, backet->key, as->refcnt);
vty_out (vty, "%s%s", as->str, VTY_NEWLINE);
}
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index e6a3660..00d766d 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -8235,7 +8235,7 @@
struct community *com;
com = (struct community *) backet->data;
- vty_out (vty, "[%p] (%ld) %s%s", backet, com->refcnt,
+ vty_out (vty, "[%p] (%ld) %s%s", (void *)backet, com->refcnt,
community_str (com), VTY_NEWLINE);
}
diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c
index a4cbba6..28525ce 100644
--- a/isisd/isis_spf.c
+++ b/isisd/isis_spf.c
@@ -1072,8 +1072,8 @@
{
zlog_warn ("ISIS-Spf: No lsp (%p) found from root "
"to L%d DR %s on %s (ID %d)",
- lsp, level, rawlspid_print (lsp_id),
- circuit->interface->name, circuit->circuit_id);
+ (void *)lsp, level, rawlspid_print (lsp_id),
+ circuit->interface->name, circuit->circuit_id);
continue;
}
isis_spf_process_pseudo_lsp (spftree, lsp,
diff --git a/lib/buffer.c b/lib/buffer.c
index 45e2e1c..b689549 100644
--- a/lib/buffer.c
+++ b/lib/buffer.c
@@ -322,7 +322,8 @@
/* This should absolutely never occur. */
zlog_err("%s: corruption detected: iov_small overflowed; "
"head %p, tail %p, head->next %p",
- __func__, b->head, b->tail, b->head->next);
+ __func__, (void *)b->head, (void *)b->tail,
+ (void *)b->head->next);
iov = XMALLOC(MTYPE_TMP, iov_alloc*sizeof(*iov));
memcpy(iov, small_iov, sizeof(small_iov));
}
diff --git a/lib/stream.c b/lib/stream.c
index c6f20c8..e13da08 100644
--- a/lib/stream.c
+++ b/lib/stream.c
@@ -53,7 +53,7 @@
*/
#define STREAM_WARN_OFFSETS(S) \
zlog_warn ("&(struct stream): %p, size: %lu, getp: %lu, endp: %lu\n", \
- (S), \
+ (void *)(S), \
(unsigned long) (S)->size, \
(unsigned long) (S)->getp, \
(unsigned long) (S)->endp)\
diff --git a/lib/zclient.c b/lib/zclient.c
index 41ecbb6..963c705 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -919,7 +919,7 @@
length -= ZEBRA_HEADER_SIZE;
if (zclient_debug)
- zlog_debug("zclient 0x%p command 0x%x \n", zclient, command);
+ zlog_debug("zclient 0x%p command 0x%x \n", (void *)zclient, command);
switch (command)
{
diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c
index 4ad7521..1ef0b53 100644
--- a/ospf6d/ospf6_intra.c
+++ b/ospf6d/ospf6_intra.c
@@ -1495,7 +1495,8 @@
zlog_info ("Brouter: %s via area %s", brouter_name, area_name);
zlog_info (" memory: prev: %p this: %p next: %p parent rnode: %p",
- brouter->prev, brouter, brouter->next, brouter->rnode);
+ (void *)brouter->prev, (void *)brouter, (void *)brouter->next,
+ (void *)brouter->rnode);
zlog_info (" type: %d prefix: %s installed: %s changed: %s",
brouter->type, destination, installed, changed);
zlog_info (" lock: %d flags: %s%s%s%s", brouter->lock,
@@ -1543,7 +1544,7 @@
IS_OSPF6_DEBUG_ROUTE (MEMORY))
{
zlog_info ("%p: mark as removing: area %s brouter %s",
- brouter, oa->name, brouter_name);
+ (void *)brouter, oa->name, brouter_name);
ospf6_brouter_debug_print (brouter);
}
}
@@ -1575,7 +1576,7 @@
IS_OSPF6_DEBUG_ROUTE (MEMORY))
{
zlog_info ("%p: transfer: area %s brouter %s",
- brouter, oa->name, brouter_name);
+ (void *)brouter, oa->name, brouter_name);
ospf6_brouter_debug_print (brouter);
}
}
diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c
index 8eeb995..b4348f4 100644
--- a/ospf6d/ospf6_lsa.c
+++ b/ospf6d/ospf6_lsa.c
@@ -494,7 +494,7 @@
vty_out (vty, "Lock: %d %s", lsa->lock, VNL);
vty_out (vty, "ReTx Count: %d%s", lsa->retrans_count, VNL);
vty_out (vty, "Threads: Expire: 0x%p, Refresh: 0x%p %s",
- lsa->expire, lsa->refresh, VNL);
+ (void *)lsa->expire, (void *)lsa->refresh, VNL);
vty_out (vty, "%s", VNL);
return;
}
diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c
index 9e6b33e..3092773 100644
--- a/ospf6d/ospf6_route.c
+++ b/ospf6d/ospf6_route.c
@@ -374,7 +374,7 @@
if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
zlog_debug ("%s %p: route add %p: %s", ospf6_route_table_name (table),
- table, route, buf);
+ (void *)table, (void *)route, buf);
else if (IS_OSPF6_DEBUG_ROUTE (TABLE))
zlog_debug ("%s: route add: %s", ospf6_route_table_name (table), buf);
@@ -408,7 +408,8 @@
{
if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
zlog_debug ("%s %p: route add %p: needless update of %p",
- ospf6_route_table_name (table), table, route, old);
+ ospf6_route_table_name (table),
+ (void *)table, (void *)route, (void *)old);
else if (IS_OSPF6_DEBUG_ROUTE (TABLE))
zlog_debug ("%s: route add: needless update",
ospf6_route_table_name (table));
@@ -422,7 +423,8 @@
if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
zlog_debug ("%s %p: route add %p: update of %p",
- ospf6_route_table_name (table), table, route, old);
+ ospf6_route_table_name (table),
+ (void *)table, (void *)route, (void *)old);
else if (IS_OSPF6_DEBUG_ROUTE (TABLE))
zlog_debug ("%s: route add: update",
ospf6_route_table_name (table));
@@ -463,7 +465,8 @@
{
if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
zlog_debug ("%s %p: route add %p: another path: prev %p, next %p",
- ospf6_route_table_name (table), table, route, prev, next);
+ ospf6_route_table_name (table),
+ (void *)table, (void *)route, (void *)prev, (void *)next);
else if (IS_OSPF6_DEBUG_ROUTE (TABLE))
zlog_debug ("%s: route add: another path found",
ospf6_route_table_name (table));
@@ -488,7 +491,8 @@
SET_FLAG (route->flag, OSPF6_ROUTE_BEST);
if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
zlog_info ("%s %p: route add %p: replacing previous best: %p",
- ospf6_route_table_name (table), table, route, next);
+ ospf6_route_table_name (table),
+ (void *)table, (void *)route, (void *)next);
}
route->installed = now;
@@ -510,7 +514,7 @@
/* Else, this is the brand new route regarding to the prefix */
if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
zlog_debug ("%s %p: route add %p: brand new route",
- ospf6_route_table_name (table), table, route);
+ ospf6_route_table_name (table), (void *)table, (void *)route);
else if (IS_OSPF6_DEBUG_ROUTE (TABLE))
zlog_debug ("%s: route add: brand new route",
ospf6_route_table_name (table));
@@ -589,7 +593,8 @@
if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
zlog_debug ("%s %p: route remove %p: %s",
- ospf6_route_table_name (table), table, route, buf);
+ ospf6_route_table_name (table),
+ (void *)table, (void *)route, buf);
else if (IS_OSPF6_DEBUG_ROUTE (TABLE))
zlog_debug ("%s: route remove: %s", ospf6_route_table_name (table), buf);
@@ -661,8 +666,8 @@
if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
zlog_info ("%s %p: route head: %p<-[%p]->%p",
- ospf6_route_table_name (table), table,
- route->prev, route, route->next);
+ ospf6_route_table_name (table), (void *)table,
+ (void *)route->prev, (void *)route, (void *)route->next);
return route;
}
@@ -674,8 +679,8 @@
if (IS_OSPF6_DEBUG_ROUTE (MEMORY))
zlog_info ("%s %p: route next: %p<-[%p]->%p",
- ospf6_route_table_name (route->table), route->table,
- route->prev, route, route->next);
+ ospf6_route_table_name (route->table), (void *)route->table,
+ (void *)route->prev, (void *)route, (void *)route->next);
ospf6_route_unlock (route);
if (next)
@@ -874,7 +879,7 @@
(CHECK_FLAG (route->flag, OSPF6_ROUTE_CHANGE) ? "C" : "-"),
VNL);
vty_out (vty, "Memory: prev: %p this: %p next: %p%s",
- route->prev, route, route->next, VNL);
+ (void *)route->prev, (void *)route, (void *)route->next, VNL);
/* Path section */
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index 47a655c..88e1285 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -639,7 +639,7 @@
{
if (IS_OSPF6_DEBUG_SPF(PROCESS) || IS_OSPF6_DEBUG_SPF (TIME))
zlog_debug ("SPF: calculation timer is already scheduled: %p",
- ospf6->t_spf_calc);
+ (void *)ospf6->t_spf_calc);
return;
}
diff --git a/ospfd/ospf_apiserver.c b/ospfd/ospf_apiserver.c
index db1ccda..92f68f7 100644
--- a/ospfd/ospf_apiserver.c
+++ b/ospfd/ospf_apiserver.c
@@ -244,7 +244,8 @@
ospf_apiserver_new_lsa_hook (struct ospf_lsa *lsa)
{
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug ("API: Put LSA(%p)[%s] into reserve, total=%ld", lsa, dump_lsa_key (lsa), lsa->lsdb->total);
+ zlog_debug ("API: Put LSA(%p)[%s] into reserve, total=%ld", (void *)lsa,
+ dump_lsa_key (lsa), lsa->lsdb->total);
return 0;
}
@@ -252,7 +253,8 @@
ospf_apiserver_del_lsa_hook (struct ospf_lsa *lsa)
{
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug ("API: Get LSA(%p)[%s] from reserve, total=%ld", lsa, dump_lsa_key (lsa), lsa->lsdb->total);
+ zlog_debug ("API: Get LSA(%p)[%s] from reserve, total=%ld", (void *)lsa,
+ dump_lsa_key (lsa), lsa->lsdb->total);
return 0;
}
@@ -395,7 +397,8 @@
listnode_delete (apiserver_list, apiserv);
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug ("API: Delete apiserv(%p), total#(%d)", apiserv, apiserver_list->count);
+ zlog_debug ("API: Delete apiserv(%p), total#(%d)",
+ (void *)apiserv, apiserver_list->count);
/* And free instance. */
XFREE (MTYPE_OSPF_APISERVER, apiserv);
@@ -755,7 +758,8 @@
#endif /* USE_ASYNC_READ */
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug ("API: New apiserv(%p), total#(%d)", apiserv, apiserver_list->count);
+ zlog_debug ("API: New apiserv(%p), total#(%d)",
+ (void *)apiserv, apiserver_list->count);
return 0;
}
@@ -944,7 +948,7 @@
if (IS_DEBUG_OSPF_EVENT)
zlog_debug ("API: Add LSA-type(%d)/Opaque-type(%d) into"
" apiserv(%p), total#(%d)",
- lsa_type, opaque_type, apiserv,
+ lsa_type, opaque_type, (void *)apiserv,
listcount (apiserv->opaque_types));
return 0;
@@ -976,7 +980,7 @@
if (IS_DEBUG_OSPF_EVENT)
zlog_debug ("API: Del LSA-type(%d)/Opaque-type(%d)"
" from apiserv(%p), total#(%d)",
- lsa_type, opaque_type, apiserv,
+ lsa_type, opaque_type, (void *)apiserv,
listcount (apiserv->opaque_types));
return 0;
diff --git a/ospfd/ospf_flood.c b/ospfd/ospf_flood.c
index d18314a..c0b3622 100644
--- a/ospfd/ospf_flood.c
+++ b/ospfd/ospf_flood.c
@@ -244,7 +244,7 @@
zlog_debug ("LSA[Flooding]: start, NBR %s (%s), cur(%p), New-LSA[%s]",
inet_ntoa (nbr->router_id),
LOOKUP (ospf_nsm_state_msg, nbr->state),
- current,
+ (void *)current,
dump_lsa_key (new));
lsa_ack_flag = 0;
@@ -584,7 +584,8 @@
* for the link on which the LSA has received.
*/
if (IS_DEBUG_OSPF (lsa, LSA_FLOODING))
- zlog_debug ("Type-9 Opaque-LSA: lsa->oi(%p) != oi(%p)", lsa->oi, oi);
+ zlog_debug ("Type-9 Opaque-LSA: lsa->oi(%p) != oi(%p)",
+ (void *)lsa->oi, (void *)oi);
continue;
}
#endif /* HAVE_OPAQUE_LSA */
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index 94c31c9..f032601 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -248,7 +248,7 @@
new->refresh_list = -1;
if (IS_DEBUG_OSPF (lsa, LSA))
- zlog_debug ("LSA: duplicated %p (new: %p)", lsa, new);
+ zlog_debug ("LSA: duplicated %p (new: %p)", (void *)lsa, (void *)new);
return new;
}
@@ -260,7 +260,7 @@
assert (lsa->lock == 0);
if (IS_DEBUG_OSPF (lsa, LSA))
- zlog_debug ("LSA: freed %p", lsa);
+ zlog_debug ("LSA: freed %p", (void *)lsa);
/* Delete LSA data. */
if (lsa->data != NULL)
@@ -336,7 +336,7 @@
{
if (IS_DEBUG_OSPF (lsa, LSA))
zlog_debug ("LSA[Type%d:%s]: data freed %p",
- lsah->type, inet_ntoa (lsah->id), lsah);
+ lsah->type, inet_ntoa (lsah->id), (void *)lsah);
XFREE (MTYPE_OSPF_LSA_DATA, lsah);
}
@@ -888,7 +888,7 @@
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
{
zlog_debug ("LSA[Type%d:%s]: Originate router-LSA %p",
- new->data->type, inet_ntoa (new->data->id), new);
+ new->data->type, inet_ntoa (new->data->id), (void *)new);
ospf_lsa_header_dump (new->data);
}
@@ -1123,7 +1123,7 @@
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
{
zlog_debug ("LSA[Type%d:%s]: Originate network-LSA %p",
- new->data->type, inet_ntoa (new->data->id), new);
+ new->data->type, inet_ntoa (new->data->id), (void *)new);
ospf_lsa_header_dump (new->data);
}
@@ -1300,7 +1300,7 @@
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
{
zlog_debug ("LSA[Type%d:%s]: Originate summary-LSA %p",
- new->data->type, inet_ntoa (new->data->id), new);
+ new->data->type, inet_ntoa (new->data->id), (void *)new);
ospf_lsa_header_dump (new->data);
}
@@ -1443,7 +1443,7 @@
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
{
zlog_debug ("LSA[Type%d:%s]: Originate summary-ASBR-LSA %p",
- new->data->type, inet_ntoa (new->data->id), new);
+ new->data->type, inet_ntoa (new->data->id), (void *)new);
ospf_lsa_header_dump (new->data);
}
@@ -2075,7 +2075,7 @@
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
{
zlog_debug ("LSA[Type%d:%s]: Originate AS-external-LSA %p",
- new->data->type, inet_ntoa (new->data->id), new);
+ new->data->type, inet_ntoa (new->data->id), (void *)new);
ospf_lsa_header_dump (new->data);
}
@@ -2260,7 +2260,8 @@
if (lsa)
{
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug ("LSA[Type5:0.0.0.0]: Refresh AS-external-LSA %p", lsa);
+ zlog_debug ("LSA[Type5:0.0.0.0]: Refresh AS-external-LSA %p",
+ (void *)lsa);
ospf_external_lsa_refresh (ospf, lsa, ei, LSA_REFRESH_FORCE);
}
else
@@ -2687,7 +2688,7 @@
{
zlog_debug ("ospf_lsa_install() Premature Aging "
"lsa 0x%p, seqnum 0x%x",
- lsa, ntohl(lsa->data->ls_seqnum));
+ (void *)lsa, ntohl(lsa->data->ls_seqnum));
ospf_lsa_header_dump (lsa->data);
}
}
@@ -2790,9 +2791,9 @@
{
if (IS_DEBUG_OSPF (lsa, LSA_INSTALL))
zlog_debug ("LSA[Type%d:%s]: Install LSA 0x%p, MaxAge",
- new->data->type,
- inet_ntoa (new->data->id),
- lsa);
+ new->data->type,
+ inet_ntoa (new->data->id),
+ (void *)lsa);
ospf_lsa_maxage (ospf, lsa);
}
@@ -2879,7 +2880,7 @@
if (CHECK_FLAG (lsa->flags, OSPF_LSA_PREMATURE_AGE))
{
if (IS_DEBUG_OSPF (lsa, LSA_FLOODING))
- zlog_debug ("originating new lsa for lsa 0x%p\n", lsa);
+ zlog_debug ("originating new lsa for lsa 0x%p\n", (void *)lsa);
ospf_lsa_refresh (ospf, lsa);
}
@@ -2946,7 +2947,7 @@
{
if (IS_DEBUG_OSPF (lsa, LSA_FLOODING))
zlog_debug ("LSA[Type%d:%s]: %p already exists on MaxAge LSA list",
- lsa->data->type, inet_ntoa (lsa->data->id), lsa);
+ lsa->data->type, inet_ntoa (lsa->data->id), (void *)lsa);
return;
}
@@ -2961,7 +2962,8 @@
{
if (IS_DEBUG_OSPF (lsa, LSA_FLOODING))
zlog_debug ("LSA[%s]: found LSA (%p) in table for LSA %p %d",
- dump_lsa_key (lsa), rn->info, lsa, lsa_prefix.prefixlen);
+ dump_lsa_key (lsa), rn->info, (void *)lsa,
+ lsa_prefix.prefixlen);
route_unlock_node (rn);
}
else
@@ -3691,7 +3693,7 @@
if (IS_DEBUG_OSPF (lsa, LSA_REFRESH))
zlog_debug ("LSA[Refresh:%s]: ospf_refresher_register_lsa(): "
"setting refresh_list on lsa %p (slod %d)",
- inet_ntoa (lsa->data->id), lsa, index);
+ inet_ntoa (lsa->data->id), (void *)lsa, index);
}
}
@@ -3762,9 +3764,9 @@
{
if (IS_DEBUG_OSPF (lsa, LSA_REFRESH))
zlog_debug ("LSA[Refresh:%s]: ospf_lsa_refresh_walker(): "
- "refresh lsa %p (slot %d)",
- inet_ntoa (lsa->data->id), lsa, i);
-
+ "refresh lsa %p (slot %d)",
+ inet_ntoa (lsa->data->id), (void *)lsa, i);
+
assert (lsa->lock > 0);
list_delete_node (refresh_list, node);
lsa->refresh_list = -1;
diff --git a/ospfd/ospf_lsdb.c b/ospfd/ospf_lsdb.c
index f7cf60f..b92e749 100644
--- a/ospfd/ospf_lsdb.c
+++ b/ospfd/ospf_lsdb.c
@@ -158,7 +158,7 @@
if (lsa)
zlog_warn ("LSA[Type%d:%s]: LSA %p, lsa->lsdb %p",
lsa->data->type, inet_ntoa (lsa->data->id),
- lsa, lsa->lsdb);
+ (void *)lsa, (void *)lsa->lsdb);
return;
}
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 98b1af3..b97e3a7 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -1681,7 +1681,7 @@
if (IS_DEBUG_OSPF_EVENT)
zlog_debug("LSA[Type%d:%s]: %p new LSA created with Link State Update",
- lsa->data->type, inet_ntoa (lsa->data->id), lsa);
+ lsa->data->type, inet_ntoa (lsa->data->id), (void *)lsa);
listnode_add (lsas, lsa);
}
@@ -1762,7 +1762,8 @@
#define DISCARD_LSA(L,N) {\
if (IS_DEBUG_OSPF_EVENT) \
- zlog_debug ("ospf_lsa_discard() in ospf_ls_upd() point %d: lsa %p Type-%d", N, lsa, (int) lsa->data->type); \
+ zlog_debug ("ospf_lsa_discard() in ospf_ls_upd() point %d: lsa %p" \
+ " Type-%d", N, (void *)lsa, (int) lsa->data->type); \
ospf_lsa_discard (L); \
continue; }
@@ -1947,7 +1948,7 @@
ospf_lsa_flush_area(lsa,out_if->area);
if(IS_DEBUG_OSPF_EVENT)
zlog_debug ("ospf_lsa_discard() in ospf_ls_upd() point 9: lsa %p Type-%d",
- lsa, (int) lsa->data->type);
+ (void *)lsa, (int) lsa->data->type);
ospf_lsa_discard (lsa);
Flag = 1;
}
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c
index 1fe8ab4..6205b3e 100644
--- a/ospfd/ospf_spf.c
+++ b/ospfd/ospf_spf.c
@@ -1014,7 +1014,7 @@
for (ALL_LIST_ELEMENTS_RO (v->parents, nnode, parent))
{
zlog_debug (" nexthop %p %s %s",
- parent->nexthop,
+ (void *)parent->nexthop,
inet_ntoa (parent->nexthop->router),
parent->nexthop->oi ? IF_NAME(parent->nexthop->oi)
: "NULL");
@@ -1444,7 +1444,7 @@
{
if (IS_DEBUG_OSPF_EVENT)
zlog_debug ("SPF: calculation timer is already scheduled: %p",
- ospf->t_spf_calc);
+ (void *)ospf->t_spf_calc);
return;
}
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
index c605ce6..bcb8963 100644
--- a/ospfd/ospf_te.c
+++ b/ospfd/ospf_te.c
@@ -556,7 +556,7 @@
if (lookup_linkparams_by_ifp (ifp) != NULL)
{
- zlog_warn ("ospf_mpls_te_new_if: ifp(%p) already in use?", ifp);
+ zlog_warn ("ospf_mpls_te_new_if: ifp(%p) already in use?", (void *)ifp);
rc = 0; /* Do nothing here. */
goto out;
}
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 0750e6e..cc7f48f 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -78,7 +78,7 @@
/* RPF lookup behaviour */
static enum multicast_mode ipv4_multicast_mode = MCAST_NO_CONFIG;
-static void
+static void __attribute__((format (printf, 4, 5)))
_rnode_zlog(const char *_func, struct route_node *rn, int priority,
const char *msgfmt, ...)
{
@@ -1394,8 +1394,9 @@
if (rib != fib)
{
if (IS_ZEBRA_DEBUG_RIB)
- rnode_debug (rn, "rn %p, removing rib %p", rn, rib);
- rib_unlink (rn, rib);
+ rnode_debug (rn, "rn %p, removing rib %p",
+ (void *)rn, (void *)rib);
+ rib_unlink (rn, rib);
}
else
del = rib;
@@ -1466,7 +1467,7 @@
{
if (IS_ZEBRA_DEBUG_RIB)
rnode_debug (rn, "Updating existing route, select %p, fib %p",
- select, fib);
+ (void *)select, (void *)fib);
if (CHECK_FLAG (select->flags, ZEBRA_FLAG_CHANGED))
{
if (info->safi == SAFI_UNICAST)
@@ -1511,7 +1512,7 @@
if (fib)
{
if (IS_ZEBRA_DEBUG_RIB)
- rnode_debug (rn, "Removing existing route, fib %p", fib);
+ rnode_debug (rn, "Removing existing route, fib %p", (void *)fib);
if (info->safi == SAFI_UNICAST)
zfpm_trigger_update (rn, "removing existing route");
@@ -1532,7 +1533,7 @@
if (select)
{
if (IS_ZEBRA_DEBUG_RIB)
- rnode_debug (rn, "Adding route, select %p", select);
+ rnode_debug (rn, "Adding route, select %p", (void *)select);
if (info->safi == SAFI_UNICAST)
zfpm_trigger_update (rn, "new route selected");
@@ -1550,13 +1551,13 @@
if (del)
{
if (IS_ZEBRA_DEBUG_RIB)
- rnode_debug (rn, "Deleting fib %p, rn %p", del, rn);
+ rnode_debug (rn, "Deleting fib %p, rn %p", (void *)del, (void *)rn);
rib_unlink (rn, del);
}
end:
if (IS_ZEBRA_DEBUG_RIB_Q)
- rnode_debug (rn, "rn %p dequeued", rn);
+ rnode_debug (rn, "rn %p dequeued", (void *)rn);
/*
* Check if the dest can be deleted now.
@@ -1651,7 +1652,7 @@
{
if (IS_ZEBRA_DEBUG_RIB_Q)
rnode_debug (rn, "rn %p is already queued in sub-queue %u",
- rn, qindex);
+ (void *)rn, qindex);
continue;
}
@@ -1662,7 +1663,7 @@
if (IS_ZEBRA_DEBUG_RIB_Q)
rnode_debug (rn, "queued rn %p into sub-queue %u",
- rn, qindex);
+ (void *)rn, qindex);
}
}
@@ -1676,7 +1677,7 @@
if (!rnode_to_ribs (rn))
{
zlog_debug ("%s: called for route_node (%p, %d) with no ribs",
- __func__, rn, rn->lock);
+ __func__, (void *)rn, rn->lock);
zlog_backtrace(LOG_DEBUG);
return;
}
@@ -1706,7 +1707,7 @@
rib_meta_queue_add (zebra->mq, rn);
if (IS_ZEBRA_DEBUG_RIB_Q)
- rnode_debug (rn, "rn %p queued", rn);
+ rnode_debug (rn, "rn %p queued", (void *)rn);
return;
}
@@ -1807,7 +1808,7 @@
assert (rib && rn);
if (IS_ZEBRA_DEBUG_RIB)
- rnode_debug (rn, "rn %p, rib %p", rn, rib);
+ rnode_debug (rn, "rn %p, rib %p", (void *)rn, (void *)rib);
dest = rib_dest_from_rnode (rn);
if (!dest)
@@ -1840,7 +1841,7 @@
if (CHECK_FLAG (rib->status, RIB_ENTRY_REMOVED))
{
if (IS_ZEBRA_DEBUG_RIB)
- rnode_debug (rn, "rn %p, un-removed rib %p", rn, rib);
+ rnode_debug (rn, "rn %p, un-removed rib %p", (void *)rn, (void *)rib);
UNSET_FLAG (rib->status, RIB_ENTRY_REMOVED);
return;
@@ -1865,7 +1866,7 @@
assert (rn && rib);
if (IS_ZEBRA_DEBUG_RIB)
- rnode_debug (rn, "rn %p, rib %p", rn, rib);
+ rnode_debug (rn, "rn %p, rib %p", (void *)rn, (void *)rib);
dest = rib_dest_from_rnode (rn);
@@ -1889,7 +1890,7 @@
rib_delnode (struct route_node *rn, struct rib *rib)
{
if (IS_ZEBRA_DEBUG_RIB)
- rnode_debug (rn, "rn %p, rib %p, removing", rn, rib);
+ rnode_debug (rn, "rn %p, rib %p, removing", (void *)rn, (void *)rib);
SET_FLAG (rib->status, RIB_ENTRY_REMOVED);
rib_queue_add (&zebrad, rn);
}
@@ -1983,14 +1984,16 @@
/* Link new rib to node.*/
if (IS_ZEBRA_DEBUG_RIB)
- zlog_debug ("%s: calling rib_addnode (%p, %p)", __func__, rn, rib);
+ zlog_debug ("%s: calling rib_addnode (%p, %p)",
+ __func__, (void *)rn, (void *)rib);
rib_addnode (rn, rib);
/* Free implicit route.*/
if (same)
{
if (IS_ZEBRA_DEBUG_RIB)
- zlog_debug ("%s: calling rib_delnode (%p, %p)", __func__, rn, rib);
+ zlog_debug ("%s: calling rib_delnode (%p, %p)",
+ __func__, (void *)rn, (void *)rib);
rib_delnode (rn, same);
}
@@ -2012,7 +2015,8 @@
int recursing;
inet_ntop (p->family, &p->u.prefix, straddr, INET6_ADDRSTRLEN);
- zlog_debug ("%s: dumping RIB entry %p for %s/%d", func, rib, straddr, p->prefixlen);
+ zlog_debug ("%s: dumping RIB entry %p for %s/%d", func, (void *)rib,
+ straddr, p->prefixlen);
zlog_debug
(
"%s: refcnt == %lu, uptime == %lu, type == %u, table == %d",
@@ -2097,8 +2101,8 @@
(
"%s: rn %p, rib %p: %s, %s",
__func__,
- rn,
- rib,
+ (void *)rn,
+ (void *)rib,
(CHECK_FLAG (rib->status, RIB_ENTRY_REMOVED) ? "removed" : "NOT removed"),
(CHECK_FLAG (rib->flags, ZEBRA_FLAG_SELECTED) ? "selected" : "NOT selected")
);
@@ -2210,7 +2214,7 @@
if (IS_ZEBRA_DEBUG_RIB)
{
zlog_debug ("%s: called rib_addnode (%p, %p) on new RIB entry",
- __func__, rn, rib);
+ __func__, (void *)rn, (void *)rib);
rib_dump (p, rib);
}
@@ -2220,7 +2224,7 @@
if (IS_ZEBRA_DEBUG_RIB)
{
zlog_debug ("%s: calling rib_delnode (%p, %p) on existing RIB entry",
- __func__, rn, same);
+ __func__, (void *)rn, (void *)same);
rib_dump (p, same);
}
rib_delnode (rn, same);
@@ -2771,7 +2775,7 @@
if (IS_ZEBRA_DEBUG_RIB)
{
zlog_debug ("%s: called rib_addnode (%p, %p) on new RIB entry",
- __func__, rn, rib);
+ __func__, (void *)rn, (void *)rib);
rib_dump (p, rib);
}
@@ -2781,7 +2785,7 @@
if (IS_ZEBRA_DEBUG_RIB)
{
zlog_debug ("%s: calling rib_delnode (%p, %p) on existing RIB entry",
- __func__, rn, same);
+ __func__, (void *)rn, (void *)same);
rib_dump (p, same);
}
rib_delnode (rn, same);