]> git.puffer.fish Git - matthieu/frr.git/commitdiff
[warnings] Fix various SOS warnings
authorPaul Jakma <paul.jakma@sun.com>
Fri, 15 Aug 2008 13:05:22 +0000 (14:05 +0100)
committerPaul Jakma <paul@quagga.net>
Fri, 22 Aug 2008 18:52:59 +0000 (19:52 +0100)
2008-08-15 Paul Jakma <paul.jakma@sun.com>

* */*: Fix various problems flagged by Sun Studio compiler.
  - '<qualifier> <storage>' obsolescent in declarations
  - empty statements (';' after ALIAS definitions)
  - implicit declarations (e.g printstack in lib/log.c)
  - "\%" in printf string instead of "%%"
  - loops that return on the first iteration (legitimately, but
      compiler can't really know), e.g. bgp_routemap.c
    - internal declarations which mask prototypes.

12 files changed:
bgpd/bgp_attr.c
bgpd/bgp_route.c
bgpd/bgp_routemap.c
lib/daemon.c
lib/filter.c
lib/log.c
lib/plist.c
ospfclient/ospfclient.c
ospfd/ospf_ism.c
ospfd/ospf_nsm.c
ospfd/ospf_vty.c
zebra/rtadv.h

index 6f139742020f3ae49d5f0794f150176f750df5c0..d116c30feb19a82b5c2b247d3e7d14a93ed24946 100644 (file)
@@ -2298,8 +2298,6 @@ bgp_packet_withdraw (struct peer *peer, struct stream *s, struct prefix *p,
 void
 bgp_attr_init (void)
 {
-  void attrhash_init ();
-
   aspath_init ();
   attrhash_init ();
   community_init ();
index b639db05c2c3f08b4753e7e79ae872f35021ef3c..4a642e34f3b19a0fd5cd2a111300d84b01875a7d 100644 (file)
@@ -9176,7 +9176,7 @@ bgp_table_stats (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi)
             vty_out (vty, "%12llu%s", ts.counts[i], VTY_NEWLINE);
             if (ts.counts[BGP_STATS_MAXBITLEN] < 9)
               break;
-            vty_out (vty, "%30s: ", "\% announced ");
+            vty_out (vty, "%30s: ", "%% announced ");
             vty_out (vty, "%12.2f%s", 
                      100 * (float)ts.counts[BGP_STATS_SPACE] / 
                        (float)((uint64_t)1UL << ts.counts[BGP_STATS_MAXBITLEN]),
index 78ad3f083648775b3b0ae5bd9d1eb677752fcac8..2d4a863006fa942c045e17de32c4704d0ba7e8e7 100644 (file)
@@ -245,9 +245,8 @@ route_match_peer (void *rule, struct prefix *prefix, route_map_object_t type,
             {
               if (sockunion_same (su, &peer->su))
                 return RMAP_MATCH;
-
-              return RMAP_NOMATCH;
             }
+          return RMAP_NOMATCH;
         }
     }
   return RMAP_NOMATCH;
@@ -2574,7 +2573,7 @@ ALIAS (no_match_ip_route_source,
        "Match advertising source address of route\n"
        "IP access-list number\n"
        "IP access-list number (expanded range)\n"
-       "IP standard access-list name\n");
+       "IP standard access-list name\n")
 
 DEFUN (match_ip_address_prefix_list, 
        match_ip_address_prefix_list_cmd,
@@ -2685,7 +2684,7 @@ ALIAS (no_match_ip_route_source_prefix_list,
        IP_STR
        "Match advertising source address of route\n"
        "Match entries of prefix-lists\n"
-       "IP prefix-list name\n");
+       "IP prefix-list name\n")
 
 DEFUN (match_metric, 
        match_metric_cmd,
index e73a74f10d59528e5bc511daa75eb5cc53d64ac8..c473555bb5d30e90eb5fc60a0741b3a814b308a5 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 #include <zebra.h>
+#include <log.h>
 
 #ifndef HAVE_DAEMON
 
index 069919bb718b89fba318aedb4b46a2f87d681605..7aeb8deb7e266c8ee4546206bd6bb57fc908c25c 100644 (file)
@@ -138,7 +138,7 @@ filter_free (struct filter *filter)
 }
 
 /* Return string of filter_type. */
-const static char *
+static const char *
 filter_type_str (struct filter *filter)
 {
   switch (filter->type)
index 677cf9ade87ff6971308313ab353fda68b86a958..407904d5df4342c19dcedb63882d36593181fdd6 100644 (file)
--- a/lib/log.c
+++ b/lib/log.c
 #ifndef SUNOS_5
 #include <sys/un.h>
 #endif
+/* for printstack on solaris */
+#ifdef HAVE_UCONTEXT_H
+#include <ucontext.h>
+#endif
 
 static int logfile_fd = -1;    /* Used in signal handler. */
 
index 6caece0e36752a4b236bea9c2cb547cf551f9191..4b498c4df458c78be4597dffdab7a4b68993f7d8 100644 (file)
@@ -518,7 +518,7 @@ prefix_list_entry_add (struct prefix_list *plist,
 }
 
 /* Return string of prefix_list_type. */
-const static char *
+static const char *
 prefix_list_type_str (struct prefix_list_entry *pentry)
 {
   switch (pentry->type)
index b00561555c8cc1c514529ef0dae7fa508290118e..ef1d22b4962b213694807f465f63b2830979b05b 100644 (file)
@@ -121,7 +121,7 @@ lsa_inject (struct thread *t)
   counter++;
 
   return 0;
-};
+}
 
 
 /* This thread handles asynchronous messages coming in from the OSPF
index 829ea00a18d9af7ffb072719c1d5d2702a34a813..f215bfc21dca1ee8d914673a622f13d332a0165a 100644 (file)
@@ -520,7 +520,7 @@ struct {
   },
 };  
 
-const static char *ospf_ism_event_str[] =
+static const char *ospf_ism_event_str[] =
 {
   "NoEvent",
   "InterfaceUp",
index 47b16af73c9e00ff84aeeeb044b74d375e530fbf..f3ac9eaaeba5c753a076a99a0a1fcd8b6ccad631 100644 (file)
@@ -576,7 +576,7 @@ struct {
   },
 };
 
-const static char *ospf_nsm_event_str[] =
+static const char *ospf_nsm_event_str[] =
 {
   "NoEvent",
   "HelloReceived",
index 5f9fa2cb90c3a30efebfbd6fa47400d951c089aa..5307b413733b9e9bda571744216116670b77fd79 100644 (file)
@@ -50,7 +50,7 @@
 #include "ospfd/ospf_dump.h"
 
 \f
-const static char *ospf_network_type_str[] =
+static const char *ospf_network_type_str[] =
 {
   "Null",
   "POINTOPOINT",
index 3665503705c2b78de873d67a721eb8d1c9f1f0cc..abd1c6fc0dcc58aee11da82c5c26a4714aef8502 100644 (file)
@@ -23,6 +23,7 @@
 #ifndef _ZEBRA_RTADV_H
 #define _ZEBRA_RTADV_H
 
+#include "vty.h"
 #include "zebra/interface.h"
 
 /* Router advertisement prefix. */