summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Hall <GMCH@hestia.halldom.com>2010-04-16 14:29:17 +0100
committerChris Hall <GMCH@hestia.halldom.com>2010-04-16 14:29:17 +0100
commita20526cc30d68ca5c4c7951238faafa8969a31c1 (patch)
treec9a0d8ee5e16ee5f42704c9c9f3122f407f13122
parentd6f1bd7b60fc94488dc6a0493a6ec17346a03b2d (diff)
downloadquagga-a20526cc30d68ca5c4c7951238faafa8969a31c1.tar.bz2
quagga-a20526cc30d68ca5c4c7951238faafa8969a31c1.tar.xz
Removing compiler warnings.
Removed nearly 100 compiler warnings in the various routing daemons which now clean compile. Removed one warning in vty.c, which was obscured by the other warnings. SO... this commit corrects the previous one.
-rw-r--r--isisd/isis_flags.c12
-rw-r--r--isisd/isis_lsp.c2
-rw-r--r--isisd/isis_misc.c6
-rw-r--r--isisd/isis_misc.h2
-rw-r--r--isisd/isis_zebra.c2
-rw-r--r--isisd/isisd.c4
-rw-r--r--isisd/topology/spgrid.c28
-rw-r--r--lib/vty.c1
-rw-r--r--ospf6d/ospf6_abr.c8
-rw-r--r--ospf6d/ospf6_asbr.c6
-rw-r--r--ospf6d/ospf6_intra.c10
-rw-r--r--ospf6d/ospf6_route.c10
-rw-r--r--ospf6d/ospf6_route.h24
-rw-r--r--ospf6d/ospf6_snmp.c11
-rw-r--r--ospf6d/ospf6_spf.c8
-rw-r--r--ospf6d/ospf6_top.c4
-rw-r--r--ospf6d/ospf6d.c4
-rw-r--r--ospfd/ospf_abr.c7
-rw-r--r--ospfd/ospf_ase.c8
-rw-r--r--ospfd/ospf_packet.c3
-rw-r--r--ospfd/ospf_route.c6
-rw-r--r--ospfd/ospf_spf.c2
-rw-r--r--ospfd/ospf_vty.c5
-rw-r--r--ospfd/ospf_zebra.c9
-rw-r--r--ospfd/ospfd.c6
-rw-r--r--ripd/rip_interface.c2
-rw-r--r--ripd/rip_snmp.c2
-rw-r--r--ripd/ripd.c8
-rw-r--r--ripd/ripd.h13
-rw-r--r--ripngd/ripng_interface.c2
-rw-r--r--ripngd/ripngd.c2
-rw-r--r--ripngd/ripngd.h9
-rw-r--r--tests/test-checksum.c6
-rw-r--r--watchquagga/watchquagga.c8
-rw-r--r--zebra/misc_null.c8
35 files changed, 158 insertions, 90 deletions
diff --git a/isisd/isis_flags.c b/isisd/isis_flags.c
index 03c91101..7d210cfd 100644
--- a/isisd/isis_flags.c
+++ b/isisd/isis_flags.c
@@ -48,10 +48,11 @@ flags_get_index (struct flags *flags)
}
else
{
+ uintptr_t pi ;
node = listhead (flags->free_idcs);
- index = (int) listgetdata (node);
- listnode_delete (flags->free_idcs, (void *) index);
- index--;
+ pi = (uintptr_t)listgetdata (node);
+ listnode_delete (flags->free_idcs, (void*)pi);
+ index = (int)(pi - 1) ;
}
return index;
@@ -60,6 +61,8 @@ flags_get_index (struct flags *flags)
void
flags_free_index (struct flags *flags, int index)
{
+ uintptr_t pi ;
+
if (index + 1 == flags->maxindex)
{
flags->maxindex--;
@@ -71,7 +74,8 @@ flags_free_index (struct flags *flags, int index)
flags->free_idcs = list_new ();
}
- listnode_add (flags->free_idcs, (void *) (index + 1));
+ pi = (uintptr_t)index + 1 ;
+ listnode_add (flags->free_idcs, (void*)pi) ;
return;
}
diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c
index 50289db3..545d43e4 100644
--- a/isisd/isis_lsp.c
+++ b/isisd/isis_lsp.c
@@ -655,7 +655,7 @@ lspid_print (u_char * lsp_id, u_char * trg, char dynhost, char frag)
if (dyn)
sprintf ((char *)id, "%.14s", dyn->name.name);
- else if (!memcmp (isis->sysid, lsp_id, ISIS_SYS_ID_LEN) & dynhost)
+ else if (!memcmp (isis->sysid, lsp_id, ISIS_SYS_ID_LEN) && dynhost)
sprintf ((char *)id, "%.14s", unix_hostname ());
else
{
diff --git a/isisd/isis_misc.c b/isisd/isis_misc.c
index 6b565bcb..fd910835 100644
--- a/isisd/isis_misc.c
+++ b/isisd/isis_misc.c
@@ -107,7 +107,7 @@ dotformat2buff (u_char * buff, const u_char * dotted)
int nextdotpos = 2;
number[2] = '\0';
- dotlen = strlen(dotted);
+ dotlen = strlen((const char*)dotted);
if (dotlen > 50)
{
/* this can't be an iso net, its too long */
@@ -165,7 +165,7 @@ sysid2buff (u_char * buff, const u_char * dotted)
number[2] = '\0';
// surely not a sysid_string if not 14 length
- if (strlen (dotted) != 14)
+ if (strlen ((const char*)dotted) != 14)
{
return 0;
}
@@ -271,7 +271,7 @@ speaks (struct nlpids *nlpids, int family)
* Returns 0 on error, IS-IS Circuit Type on ok
*/
int
-string2circuit_t (const u_char * str)
+string2circuit_t (const char * str)
{
if (!str)
diff --git a/isisd/isis_misc.h b/isisd/isis_misc.h
index d5003a8e..dbf0060a 100644
--- a/isisd/isis_misc.h
+++ b/isisd/isis_misc.h
@@ -24,7 +24,7 @@
#ifndef _ZEBRA_ISIS_MISC_H
#define _ZEBRA_ISIS_MISC_H
-int string2circuit_t (const u_char *);
+int string2circuit_t (const char *);
const char *circuit_t2string (int);
const char *syst2string (int);
struct in_addr newprefix2inaddr (u_char * prefix_start,
diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c
index 9ee5ffc5..94c3f351 100644
--- a/isisd/isis_zebra.c
+++ b/isisd/isis_zebra.c
@@ -332,7 +332,7 @@ isis_zebra_route_del_ipv4 (struct prefix *prefix,
}
#ifdef HAVE_IPV6
-void
+static void
isis_zebra_route_add_ipv6 (struct prefix *prefix,
struct isis_route_info *route_info)
{
diff --git a/isisd/isisd.c b/isisd/isisd.c
index 1e84a1ce..9b07ab88 100644
--- a/isisd/isisd.c
+++ b/isisd/isisd.c
@@ -1016,7 +1016,7 @@ DEFUN (net,
"A Network Entity Title for this process (OSI only)\n"
"XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
{
- return area_net_title (vty, argv[0]);
+ return area_net_title (vty, (const u_char*)argv[0]);
}
/*
@@ -1029,7 +1029,7 @@ DEFUN (no_net,
"A Network Entity Title for this process (OSI only)\n"
"XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
{
- return area_clear_net_title (vty, argv[0]);
+ return area_clear_net_title (vty, (const u_char*)argv[0]);
}
DEFUN (area_passwd,
diff --git a/isisd/topology/spgrid.c b/isisd/topology/spgrid.c
index 611b6727..5197beb1 100644
--- a/isisd/topology/spgrid.c
+++ b/isisd/topology/spgrid.c
@@ -50,8 +50,8 @@ long X, /* horizontal size of grid */
long x,
y,
- y1, y2, yp,
- dl, dx, xn, yn, count,
+ yr1, yr2, yp,
+ dl, dx, xnd, ynd, count,
*mess;
double n;
@@ -670,12 +670,12 @@ gen_spgrid_topology (struct vty *vty, struct list *topology)
for ( k = ax; k > 0; k -- )
{
- y1 = nrand ( Y );
+ yr1 = nrand ( Y );
do
- y2 = nrand ( Y );
- while ( y2 == y1 );
- i = NODE ( x, y1 );
- j = NODE ( x, y2 );
+ yr2 = nrand ( Y );
+ while ( yr2 == yr1 );
+ i = NODE ( x, yr1 );
+ j = NODE ( x, yr2 );
l = am + nrand ( al );
print_arc (vty, topology, i, j, l );
}
@@ -697,9 +697,9 @@ gen_spgrid_topology (struct vty *vty, struct list *topology)
for ( x = 0; x < X-1; x ++ )
{
/* generating arcs from one layer */
- for ( count = 0, xn = x + 1;
- count < ix && xn < X;
- count ++, xn += ih )
+ for ( count = 0, xnd = x + 1;
+ count < ix && xnd < X;
+ count ++, xnd += ih )
{
if ( ip_f )
for ( y = 0; y < Y; y ++ )
@@ -708,16 +708,16 @@ gen_spgrid_topology (struct vty *vty, struct list *topology)
for ( y = 0; y < Y; y ++ )
{
i = NODE ( x, y );
- dx = xn - x;
+ dx = xnd - x;
if ( ip_f )
{
yp = nrand(Y-y);
- yn = mess[ yp ];
+ ynd = mess[ yp ];
mess[ yp ] = mess[ Y - y - 1 ];
}
else
- yn = y;
- j = NODE ( xn, yn );
+ ynd = y;
+ j = NODE ( xnd, ynd );
l = im + nrand ( il );
if ( in != 0 )
l *= (long) ( in * dx );
diff --git a/lib/vty.c b/lib/vty.c
index 88d7139b..749b2155 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -34,6 +34,7 @@
#include "command.h"
#include "command_queue.h"
+#include "command_execute.h"
#include "memory.h"
#include "log.h"
#include "mqueue.h"
diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c
index d38ef21a..e03ec842 100644
--- a/ospf6d/ospf6_abr.c
+++ b/ospf6d/ospf6_abr.c
@@ -162,7 +162,7 @@ ospf6_abr_originate_summary_to_area (struct ospf6_route *route,
if (IS_OSPF6_DEBUG_ABR || IS_OSPF6_DEBUG_ORIGINATE (INTER_ROUTER))
{
is_debug++;
- inet_ntop (AF_INET, &(ADV_ROUTER_IN_PREFIX (&route->prefix)),
+ inet_ntop (AF_INET, &(ADV_ROUTER_IN_PREFIX (route->prefix)),
buf, sizeof (buf));
zlog_debug ("Originating summary in area %s for ASBR %s",
area->name, buf);
@@ -355,7 +355,7 @@ ospf6_abr_originate_summary_to_area (struct ospf6_route *route,
{
if (is_debug)
{
- inet_ntop (AF_INET, &(ADV_ROUTER_IN_PREFIX (&route->prefix)),
+ inet_ntop (AF_INET, &(ADV_ROUTER_IN_PREFIX (route->prefix)),
buf, sizeof(buf));
zlog_debug ("prefix %s was denied by export list", buf);
}
@@ -376,7 +376,7 @@ ospf6_abr_originate_summary_to_area (struct ospf6_route *route,
{
if (is_debug)
{
- inet_ntop (AF_INET, &(ADV_ROUTER_IN_PREFIX (&route->prefix)),
+ inet_ntop (AF_INET, &(ADV_ROUTER_IN_PREFIX (route->prefix)),
buf, sizeof (buf));
zlog_debug ("prefix %s was denied by filter-list out", buf);
}
@@ -430,7 +430,7 @@ ospf6_abr_originate_summary_to_area (struct ospf6_route *route,
router_lsa->options[1] = route->path.options[1];
router_lsa->options[2] = route->path.options[2];
OSPF6_ABR_SUMMARY_METRIC_SET (router_lsa, route->path.cost);
- router_lsa->router_id = ADV_ROUTER_IN_PREFIX (&route->prefix);
+ router_lsa->router_id = ADV_ROUTER_IN_PREFIX (route->prefix);
type = htons (OSPF6_LSTYPE_INTER_ROUTER);
}
else
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index 685b147c..1bf98559 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -302,14 +302,14 @@ ospf6_asbr_lsentry_add (struct ospf6_route *asbr_entry)
if (! CHECK_FLAG (asbr_entry->flag, OSPF6_ROUTE_BEST))
{
char buf[16];
- inet_ntop (AF_INET, &ADV_ROUTER_IN_PREFIX (&asbr_entry->prefix),
+ inet_ntop (AF_INET, &ADV_ROUTER_IN_PREFIX (asbr_entry->prefix),
buf, sizeof (buf));
zlog_info ("ignore non-best path: lsentry %s add", buf);
return;
}
type = htons (OSPF6_LSTYPE_AS_EXTERNAL);
- router = ospf6_linkstate_prefix_adv_router (&asbr_entry->prefix);
+ router = ospf6_linkstate_prefix_adv_router (asbr_entry->prefix);
for (lsa = ospf6_lsdb_type_router_head (type, router, ospf6->lsdb); lsa;
lsa = ospf6_lsdb_type_router_next (type, router, lsa))
{
@@ -326,7 +326,7 @@ ospf6_asbr_lsentry_remove (struct ospf6_route *asbr_entry)
u_int32_t router;
type = htons (OSPF6_LSTYPE_AS_EXTERNAL);
- router = ospf6_linkstate_prefix_adv_router (&asbr_entry->prefix);
+ router = ospf6_linkstate_prefix_adv_router (asbr_entry->prefix);
for (lsa = ospf6_lsdb_type_router_head (type, router, ospf6->lsdb);
lsa; lsa = ospf6_lsdb_type_router_next (type, router, lsa))
ospf6_asbr_lsa_remove (lsa);
diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c
index 05b11ba3..b30398f0 100644
--- a/ospf6d/ospf6_intra.c
+++ b/ospf6d/ospf6_intra.c
@@ -1250,7 +1250,7 @@ ospf6_brouter_debug_print (struct ospf6_route *brouter)
char id[16], adv_router[16];
char capa[16], options[16];
- brouter_id = ADV_ROUTER_IN_PREFIX (&brouter->prefix);
+ brouter_id = ADV_ROUTER_IN_PREFIX (brouter->prefix);
inet_ntop (AF_INET, &brouter_id, brouter_name, sizeof (brouter_name));
inet_ntop (AF_INET, &brouter->path.area_id, area_name, sizeof (area_name));
ospf6_linkstate_prefix2str (&brouter->prefix, destination,
@@ -1311,7 +1311,7 @@ ospf6_intra_brouter_calculation (struct ospf6_area *oa)
for (brouter = ospf6_route_head (oa->ospf6->brouter_table); brouter;
brouter = ospf6_route_next (brouter))
{
- brouter_id = ADV_ROUTER_IN_PREFIX (&brouter->prefix);
+ brouter_id = ADV_ROUTER_IN_PREFIX (brouter->prefix);
inet_ntop (AF_INET, &brouter_id, brouter_name, sizeof (brouter_name));
if (brouter->path.area_id != oa->area_id)
continue;
@@ -1329,12 +1329,12 @@ ospf6_intra_brouter_calculation (struct ospf6_area *oa)
for (brouter = ospf6_route_head (oa->spf_table); brouter;
brouter = ospf6_route_next (brouter))
{
- brouter_id = ADV_ROUTER_IN_PREFIX (&brouter->prefix);
+ brouter_id = ADV_ROUTER_IN_PREFIX (brouter->prefix);
inet_ntop (AF_INET, &brouter_id, brouter_name, sizeof (brouter_name));
if (brouter->type != OSPF6_DEST_TYPE_LINKSTATE)
continue;
- if (ospf6_linkstate_prefix_id (&brouter->prefix) != htonl (0))
+ if (ospf6_linkstate_prefix_id (brouter->prefix) != htonl (0))
continue;
if (! CHECK_FLAG (brouter->path.router_bits, OSPF6_ROUTER_BIT_E) &&
! CHECK_FLAG (brouter->path.router_bits, OSPF6_ROUTER_BIT_B))
@@ -1360,7 +1360,7 @@ ospf6_intra_brouter_calculation (struct ospf6_area *oa)
for (brouter = ospf6_route_head (oa->ospf6->brouter_table); brouter;
brouter = ospf6_route_next (brouter))
{
- brouter_id = ADV_ROUTER_IN_PREFIX (&brouter->prefix);
+ brouter_id = ADV_ROUTER_IN_PREFIX (brouter->prefix);
inet_ntop (AF_INET, &brouter_id, brouter_name, sizeof (brouter_name));
if (brouter->path.area_id != oa->area_id)
diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c
index 1e1f4fb5..8c1746c7 100644
--- a/ospf6d/ospf6_route.c
+++ b/ospf6d/ospf6_route.c
@@ -1070,7 +1070,7 @@ ospf6_route_show_table (struct vty *vty, int detail,
}
int
-ospf6_route_table_show (struct vty *vty, int argc, const char *argv[],
+ospf6_route_table_show (struct vty *vty, int argc, argv_t argv,
struct ospf6_route_table *table)
{
int summary = 0;
@@ -1183,9 +1183,9 @@ ospf6_linkstate_show (struct vty *vty, struct ospf6_route *route)
u_int32_t router, id;
char routername[16], idname[16], rbits[16], options[16];
- router = ospf6_linkstate_prefix_adv_router (&route->prefix);
+ router = ospf6_linkstate_prefix_adv_router (route->prefix);
inet_ntop (AF_INET, &router, routername, sizeof (routername));
- id = ospf6_linkstate_prefix_id (&route->prefix);
+ id = ospf6_linkstate_prefix_id (route->prefix);
inet_ntop (AF_INET, &id, idname, sizeof (idname));
ospf6_capability_printbuf (route->path.router_bits, rbits, sizeof (rbits));
@@ -1245,7 +1245,7 @@ ospf6_linkstate_show_table (struct vty *vty, int detail,
}
int
-ospf6_linkstate_table_show (struct vty *vty, int argc, const char *argv[],
+ospf6_linkstate_table_show (struct vty *vty, int argc, argv_t argv,
struct ospf6_route_table *table)
{
int detail = 0;
@@ -1320,7 +1320,7 @@ ospf6_brouter_show (struct vty *vty, struct ospf6_route *route)
u_int32_t adv_router;
char adv[16], rbits[16], options[16], area[16];
- adv_router = ospf6_linkstate_prefix_adv_router (&route->prefix);
+ adv_router = ospf6_linkstate_prefix_adv_router (route->prefix);
inet_ntop (AF_INET, &adv_router, adv, sizeof (adv));
ospf6_capability_printbuf (route->path.router_bits, rbits, sizeof (rbits));
ospf6_options_printbuf (route->path.options, options, sizeof (options));
diff --git a/ospf6d/ospf6_route.h b/ospf6d/ospf6_route.h
index 8dcc877f..22ecd3ff 100644
--- a/ospf6d/ospf6_route.h
+++ b/ospf6d/ospf6_route.h
@@ -235,17 +235,21 @@ extern const char *ospf6_path_type_substr[OSPF6_PATH_TYPE_MAX];
sizeof (struct ospf6_nexthop) * OSPF6_MULTI_PATH_LIMIT) == 0)
#define ospf6_route_is_best(r) (CHECK_FLAG ((r)->flag, OSPF6_ROUTE_BEST))
-#define ospf6_linkstate_prefix_adv_router(x) \
- (*(u_int32_t *)(&(x)->u.prefix6.s6_addr[0]))
-#define ospf6_linkstate_prefix_id(x) \
- (*(u_int32_t *)(&(x)->u.prefix6.s6_addr[4]))
+#ifdef s6_addr32
+#define OSPF6_PREFIX_PART(x, n) ((x).u.prefix6.s6_addr32[n])
+#else
+#define OSPF6_PREFIX_PART(x, n) ( ( (uint32_t*)((x).u.prefix6.s6_addr) )[n] )
+#endif
-#define ADV_ROUTER_IN_PREFIX(x) \
- (*(u_int32_t *)(&(x)->u.prefix6.s6_addr[0]))
-#define ID_IN_PREFIX(x) \
- (*(u_int32_t *)(&(x)->u.prefix6.s6_addr[4]))
+#define ospf6_linkstate_prefix_adv_router(x) OSPF6_PREFIX_PART(x, 0)
+#define ospf6_linkstate_prefix_id(x) OSPF6_PREFIX_PART(x, 1)
+
+#define ADV_ROUTER_IN_PREFIX(x) OSPF6_PREFIX_PART(x, 0)
+#define ID_IN_PREFIX(x) OSPF6_PREFIX_PART(x, 1)
/* Function prototype */
+#include "command.h"
+
extern void ospf6_linkstate_prefix (u_int32_t adv_router, u_int32_t id,
struct prefix *prefix);
extern void ospf6_linkstate_prefix2str (struct prefix *prefix, char *buf,
@@ -288,10 +292,10 @@ extern void ospf6_route_dump (struct ospf6_route_table *table);
extern void ospf6_route_show (struct vty *vty, struct ospf6_route *route);
extern void ospf6_route_show_detail (struct vty *vty, struct ospf6_route *route);
-extern int ospf6_route_table_show (struct vty *, int, const char *[],
+extern int ospf6_route_table_show (struct vty *, int, argv_t,
struct ospf6_route_table *);
extern int ospf6_linkstate_table_show (struct vty *vty, int argc,
- const char *argv[],
+ argv_t argv,
struct ospf6_route_table *table);
extern void ospf6_brouter_show_header (struct vty *vty);
diff --git a/ospf6d/ospf6_snmp.c b/ospf6d/ospf6_snmp.c
index 5ac7846d..25572a7c 100644
--- a/ospf6d/ospf6_snmp.c
+++ b/ospf6d/ospf6_snmp.c
@@ -306,6 +306,7 @@ ospfv3AreaEntry (struct variable *v, oid *name, size_t *length,
{
struct ospf6_area *oa, *area = NULL;
u_int32_t area_id = 0;
+ struct in_addr in_area_id ;
struct listnode *node;
unsigned int len;
@@ -319,9 +320,9 @@ ospfv3AreaEntry (struct variable *v, oid *name, size_t *length,
if (len)
oid2in_addr (name + v->namelen, len, (struct in_addr *) &area_id);
+ in_area_id.s_addr = area_id ;
zlog_debug ("SNMP access by area: %s, exact=%d len=%d length=%lu",
- inet_ntoa (* (struct in_addr *) &area_id),
- exact, len, (u_long)*length);
+ inet_ntoa (in_area_id), exact, len, (u_long)*length);
for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa))
{
@@ -398,7 +399,7 @@ ospfv3AreaLsdbEntry (struct variable *v, oid *name, size_t *length,
return NULL;
/* Parse area-id */
- len = (offsetlen < IN_ADDR_SIZE ? offsetlen : IN_ADDR_SIZE);
+ len = (offsetlen < (int)IN_ADDR_SIZE ? offsetlen : (int)IN_ADDR_SIZE);
if (len)
oid2in_addr (offset, len, &area_id);
offset += len;
@@ -412,14 +413,14 @@ ospfv3AreaLsdbEntry (struct variable *v, oid *name, size_t *length,
offsetlen -= len;
/* Parse Router-ID */
- len = (offsetlen < IN_ADDR_SIZE ? offsetlen : IN_ADDR_SIZE);
+ len = (offsetlen < (int)IN_ADDR_SIZE ? offsetlen : (int)IN_ADDR_SIZE);
if (len)
oid2in_addr (offset, len, &adv_router);
offset += len;
offsetlen -= len;
/* Parse LS-ID */
- len = (offsetlen < IN_ADDR_SIZE ? offsetlen : IN_ADDR_SIZE);
+ len = (offsetlen < (int)IN_ADDR_SIZE ? offsetlen : (int)IN_ADDR_SIZE);
if (len)
oid2in_addr (offset, len, &id);
offset += len;
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index bfb6df2e..767f5255 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -60,13 +60,13 @@ ospf6_vertex_id_cmp (void *a, void *b)
struct ospf6_vertex *vb = (struct ospf6_vertex *) b;
int ret = 0;
- ret = ntohl (ospf6_linkstate_prefix_adv_router (&va->vertex_id)) -
- ntohl (ospf6_linkstate_prefix_adv_router (&vb->vertex_id));
+ ret = ntohl (ospf6_linkstate_prefix_adv_router (va->vertex_id)) -
+ ntohl (ospf6_linkstate_prefix_adv_router (vb->vertex_id));
if (ret)
return ret;
- ret = ntohl (ospf6_linkstate_prefix_id (&va->vertex_id)) -
- ntohl (ospf6_linkstate_prefix_id (&vb->vertex_id));
+ ret = ntohl (ospf6_linkstate_prefix_id (va->vertex_id)) -
+ ntohl (ospf6_linkstate_prefix_id (vb->vertex_id));
return ret;
}
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index 65a184fb..9305b23f 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -96,7 +96,7 @@ ospf6_top_route_hook_remove (struct ospf6_route *route)
static void
ospf6_top_brouter_hook_add (struct ospf6_route *route)
{
- ospf6_abr_examin_brouter (ADV_ROUTER_IN_PREFIX (&route->prefix));
+ ospf6_abr_examin_brouter (ADV_ROUTER_IN_PREFIX (route->prefix));
ospf6_asbr_lsentry_add (route);
ospf6_abr_originate_summary (route);
}
@@ -104,7 +104,7 @@ ospf6_top_brouter_hook_add (struct ospf6_route *route)
static void
ospf6_top_brouter_hook_remove (struct ospf6_route *route)
{
- ospf6_abr_examin_brouter (ADV_ROUTER_IN_PREFIX (&route->prefix));
+ ospf6_abr_examin_brouter (ADV_ROUTER_IN_PREFIX (route->prefix));
ospf6_asbr_lsentry_remove (route);
ospf6_abr_originate_summary (route);
}
diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c
index 837a718e..0b7a1ff5 100644
--- a/ospf6d/ospf6d.c
+++ b/ospf6d/ospf6d.c
@@ -125,7 +125,7 @@ config_write_ospf6_debug (struct vty *vty)
"%s AS Scoped Link State Database%s%s"
static int
-parse_show_level (int argc, const char *argv[])
+parse_show_level (int argc, argv_t argv)
{
int level = 0;
if (argc)
@@ -143,7 +143,7 @@ parse_show_level (int argc, const char *argv[])
}
static u_int16_t
-parse_type_spec (int argc, const char *argv[])
+parse_type_spec (int argc, argv_t argv)
{
u_int16_t type = 0;
assert (argc);
diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c
index 7e32195b..4ba97844 100644
--- a/ospfd/ospf_abr.c
+++ b/ospfd/ospf_abr.c
@@ -616,6 +616,10 @@ set_metric (struct ospf_lsa *lsa, u_int32_t metric)
static int
ospf_abr_check_nssa_range (struct prefix_ipv4 *p, u_int32_t cost,
+ struct ospf_area *area)
+ __attribute__((unused)) ;
+static int
+ospf_abr_check_nssa_range (struct prefix_ipv4 *p, u_int32_t cost,
struct ospf_area *area)
{
/* The Type-7 is tested against the aggregated prefix and forwarded
@@ -1578,6 +1582,9 @@ ospf_abr_send_nssa_aggregates (struct ospf *ospf) /* temporarily turned off */
}
static void
+ospf_abr_announce_nssa_defaults (struct ospf *ospf) __attribute__((unused)) ;
+
+static void
ospf_abr_announce_nssa_defaults (struct ospf *ospf) /* By ABR-Translator */
{
struct listnode *node;
diff --git a/ospfd/ospf_ase.c b/ospfd/ospf_ase.c
index 5d0cae42..59e02bca 100644
--- a/ospfd/ospf_ase.c
+++ b/ospfd/ospf_ase.c
@@ -135,7 +135,6 @@ ospf_ase_complete_direct_routes (struct ospf_route *ro, struct in_addr nexthop)
{
struct listnode *node;
struct ospf_path *op;
- struct interface *ifp;
for (ALL_LIST_ELEMENTS_RO (ro->paths, node, op))
if (op->nexthop.s_addr == 0)
@@ -451,8 +450,7 @@ ospf_ase_calculate_route (struct ospf *ospf, struct ospf_lsa * lsa)
/* if there is a Intra/Inter area route to the N
do not install external route */
- if (rn = route_node_lookup (ospf->new_table,
- (struct prefix *) &p))
+ if ( (rn = route_node_lookup (ospf->new_table, (struct prefix *) &p)) )
{
route_unlock_node(rn);
if (rn->info == NULL)
@@ -463,8 +461,8 @@ ospf_ase_calculate_route (struct ospf *ospf, struct ospf_lsa * lsa)
}
/* Find a route to the same dest */
/* If there is no route, create new one. */
- if (rn = route_node_lookup (ospf->new_external_route,
- (struct prefix *) &p))
+ if ( (rn = route_node_lookup (ospf->new_external_route,
+ (struct prefix *) &p)) )
route_unlock_node(rn);
if (!rn || (or = rn->info) == NULL)
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 8f61ed1a..d8ff41d4 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -606,8 +606,7 @@ ospf_write (struct thread *thread)
* and reliability - not more data, than our
* socket can accept
*/
- maxdatasize = MIN (oi->ifp->mtu, ospf->maxsndbuflen) -
- sizeof (struct ip);
+ maxdatasize = MIN((int)oi->ifp->mtu, ospf->maxsndbuflen) - sizeof (struct ip);
/* Get one packet from queue. */
op = ospf_fifo_head (oi->obuf);
diff --git a/ospfd/ospf_route.c b/ospfd/ospf_route.c
index 267237b8..f1251e99 100644
--- a/ospfd/ospf_route.c
+++ b/ospfd/ospf_route.c
@@ -274,7 +274,11 @@ ospf_route_install (struct ospf *ospf, struct route_table *rt)
static void
ospf_intra_route_add (struct route_table *rt, struct vertex *v,
- struct ospf_area *area)
+ struct ospf_area *area)
+ __attribute__((unused)) ;
+static void
+ospf_intra_route_add (struct route_table *rt, struct vertex *v,
+ struct ospf_area *area)
{
struct route_node *rn;
struct ospf_route *or;
diff --git a/ospfd/ospf_spf.c b/ospfd/ospf_spf.c
index ca200222..e41492a5 100644
--- a/ospfd/ospf_spf.c
+++ b/ospfd/ospf_spf.c
@@ -1044,6 +1044,8 @@ ospf_rtrs_free (struct route_table *rtrs)
}
route_table_finish (rtrs);
}
+static void
+ospf_rtrs_print (struct route_table *rtrs) __attribute__((unused)) ;
static void
ospf_rtrs_print (struct route_table *rtrs)
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 0401f38e..cd4d1ddf 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -1569,7 +1569,7 @@ DEFUN (no_ospf_area_stub_no_summary,
}
static int
-ospf_area_nssa_cmd_handler (struct vty *vty, int argc, const char *argv[],
+ospf_area_nssa_cmd_handler (struct vty *vty, int argc, argv_t argv,
int nosum)
{
struct ospf *ospf = vty->index;
@@ -3758,6 +3758,9 @@ show_as_external_lsa_detail (struct vty *vty, struct ospf_lsa *lsa)
/* N.B. This function currently seems to be unused. */
static int
+show_as_external_lsa_stdvty (struct ospf_lsa *lsa) __attribute__((unused)) ;
+
+static int
show_as_external_lsa_stdvty (struct ospf_lsa *lsa)
{
struct as_external_lsa *al = (struct as_external_lsa *) lsa->data;
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index 513d04d9..72f0ede4 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -133,8 +133,9 @@ ospf_interface_delete (int command, struct zclient *zclient,
if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
zlog_debug
- ("Zebra: interface delete %s index %d flags %lld metric %d mtu %d",
- ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
+ ("Zebra: interface delete %s index %d flags %llu metric %d mtu %d",
+ ifp->name, ifp->ifindex, (long long unsigned)ifp->flags,
+ ifp->metric, ifp->mtu);
#ifdef HAVE_SNMP
ospf_snmp_if_delete (ifp);
@@ -967,6 +968,7 @@ void
ospf_distribute_list_update (struct ospf *ospf, int type)
{
struct route_table *rt;
+ uintptr_t pi ;
/* External info does not exist. */
if (!(rt = EXTERNAL_INFO (type)))
@@ -977,9 +979,10 @@ ospf_distribute_list_update (struct ospf *ospf, int type)
OSPF_TIMER_OFF (ospf->t_distribute_update);
/* Set timer. */
+ pi = type ;
ospf->t_distribute_update =
thread_add_timer (master, ospf_distribute_list_update_timer,
- (void *) type, OSPF_DISTRIBUTE_UPDATE_DELAY);
+ (void*)pi, OSPF_DISTRIBUTE_UPDATE_DELAY) ;
}
/* If access-list is updated, apply some check. */
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index a7553e73..a5b3b1aa 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -1208,7 +1208,11 @@ ospf_area_nssa_translator_role_set (struct ospf *ospf, struct in_addr area_id,
/* XXX: unused? Leave for symmetry? */
static int
ospf_area_nssa_translator_role_unset (struct ospf *ospf,
- struct in_addr area_id)
+ struct in_addr area_id)
+ __attribute__((unused)) ;
+static int
+ospf_area_nssa_translator_role_unset (struct ospf *ospf,
+ struct in_addr area_id)
{
struct ospf_area *area;
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c
index d3b55fc0..c1291a1d 100644
--- a/ripd/rip_interface.c
+++ b/ripd/rip_interface.c
@@ -839,7 +839,7 @@ rip_enable_network_add (struct prefix *p)
return -1;
}
else
- node->info = (char *) "enabled";
+ node->info = rip_enabled_string.p ;
/* XXX: One should find a better solution than a generic one */
rip_enable_apply_all();
diff --git a/ripd/rip_snmp.c b/ripd/rip_snmp.c
index 61c47c71..36423f6e 100644
--- a/ripd/rip_snmp.c
+++ b/ripd/rip_snmp.c
@@ -317,7 +317,7 @@ rip2PeerLookup (struct variable *v, oid name[], size_t *length,
peer = rip_peer_lookup (addr);
if (peer)
{
- if ((len < sizeof (struct in_addr) + 1) ||
+ if ((len < (int)sizeof (struct in_addr) + 1) ||
(peer->domain > name[v->namelen + sizeof (struct in_addr)]))
{
oid_copy_addr (name + v->namelen, &peer->addr,
diff --git a/ripd/ripd.c b/ripd/ripd.c
index 5a6dbc8c..6a592b0a 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -61,6 +61,11 @@ long rip_global_route_changes = 0;
/* RIP queries. */
long rip_global_queries = 0;
+
+/* Strings... */
+union rip_miyagi_string rip_enabled_string = { .cp = "enabled" } ;
+union rip_miyagi_string rip_static_string = { .cp = "static" } ;
+
/* Prototypes. */
static void rip_event (enum rip_event, int);
@@ -1110,6 +1115,7 @@ rip_response_process (struct rip_packet *packet, int size,
/* We don't know yet. */
subnetted = -1;
+ ifaddr.prefixlen = 0 ; /* eliminate a compiler warning */
/* The Response must be ignored if it is not from the RIP
port. (RFC2453 - Sec. 3.9.2)*/
@@ -2932,7 +2938,7 @@ DEFUN (rip_route,
return CMD_WARNING;
}
- node->info = (char *)"static";
+ node->info = rip_static_string.p ;
rip_redistribute_add (ZEBRA_ROUTE_RIP, RIP_ROUTE_STATIC, &p, 0, NULL, 0, 0);
diff --git a/ripd/ripd.h b/ripd/ripd.h
index 45b07b9c..db2dbde0 100644
--- a/ripd/ripd.h
+++ b/ripd/ripd.h
@@ -302,7 +302,7 @@ struct rip_peer
struct in_addr addr;
/* Peer RIP tag value. */
- int domain;
+ unsigned int domain;
/* Last update time. */
time_t uptime;
@@ -438,4 +438,15 @@ extern struct thread_master *master;
/* RIP statistics for SNMP. */
extern long rip_global_route_changes;
extern long rip_global_queries;
+
+/* To avoid compiler warnings. */
+union rip_miyagi_string
+{
+ const char* cp ;
+ char* p ;
+} ;
+
+extern union rip_miyagi_string rip_enabled_string ;
+extern union rip_miyagi_string rip_static_string ;
+
#endif /* _ZEBRA_RIP_H */
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c
index 6718fff2..cd458ef1 100644
--- a/ripngd/ripng_interface.c
+++ b/ripngd/ripng_interface.c
@@ -590,7 +590,7 @@ ripng_enable_network_add (struct prefix *p)
return -1;
}
else
- node->info = (char *) "enabled";
+ node->info = ripng_enabled_string.p ;
/* XXX: One should find a better solution than a generic one */
ripng_enable_apply_all();
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index 6e32d83c..fb6b6423 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -55,6 +55,8 @@ enum
extern struct zebra_privs_t ripngd_privs;
+union ripng_miyagi_string ripng_enabled_string = { .cp = "enable" } ;
+
/* Prototypes. */
void
ripng_output_process (struct interface *, struct sockaddr_in6 *, int);
diff --git a/ripngd/ripngd.h b/ripngd/ripngd.h
index ab06d81b..f2124501 100644
--- a/ripngd/ripngd.h
+++ b/ripngd/ripngd.h
@@ -342,6 +342,15 @@ extern struct ripng *ripng;
extern struct thread_master *master;
+/* To avoid compiler warnings. */
+union ripng_miyagi_string
+{
+ const char* cp ;
+ char* p ;
+} ;
+
+extern union ripng_miyagi_string ripng_enabled_string ;
+
/* Prototypes. */
extern void ripng_init (void);
extern void ripng_reset (void);
diff --git a/tests/test-checksum.c b/tests/test-checksum.c
index 5fb5d0dd..076dd4ad 100644
--- a/tests/test-checksum.c
+++ b/tests/test-checksum.c
@@ -26,8 +26,10 @@ typedef uint16_t testoff_t;
#define MODX 4102
/* Accumulator phase of checksum */
-static
-struct acc_vals
+static struct acc_vals
+accumulate (u_char *buffer, testsz_t len, testoff_t off)
+ __attribute__((unused)) ;
+static struct acc_vals
accumulate (u_char *buffer, testsz_t len, testoff_t off)
{
u_int8_t *p;
diff --git a/watchquagga/watchquagga.c b/watchquagga/watchquagga.c
index d4416224..2f01080c 100644
--- a/watchquagga/watchquagga.c
+++ b/watchquagga/watchquagga.c
@@ -346,8 +346,14 @@ run_background(const char *shell_cmd)
if (setpgid(0,0) < 0)
zlog_warn("warning: setpgid(0,0) failed: %s",safe_strerror(errno));
{
+ union
+ {
+ const char* const* cp ;
+ char* const* p ;
+ } miyagi ;
const char *const argv[4] = { "sh", "-c", shell_cmd, NULL};
- execv("/bin/sh",(char *const *)argv);
+ miyagi.cp = argv ;
+ execv("/bin/sh", miyagi.p);
zlog_err("execv(/bin/sh -c '%s') failed: %s",
shell_cmd,safe_strerror(errno));
_exit(127);
diff --git a/zebra/misc_null.c b/zebra/misc_null.c
index 73594301..d1d17f71 100644
--- a/zebra/misc_null.c
+++ b/zebra/misc_null.c
@@ -5,7 +5,9 @@
#include "zebra/irdp.h"
#include "zebra/interface.h"
-void ifstat_update_proc (void) { return; }
-#pragma weak rtadv_config_write = ifstat_update_proc
-#pragma weak irdp_config_write = ifstat_update_proc
+extern void ifstat_update_proc (void) ;
+extern void ifstat_update_proc (void) { return; } ;
+
+#pragma weak rtadv_config_write = ifstat_update_proc
+#pragma weak irdp_config_write = ifstat_update_proc
#pragma weak ifstat_update_sysctl = ifstat_update_proc