]> git.puffer.fish Git - matthieu/frr.git/commitdiff
*: fix compiler warnings
authorDavid Lamparter <equinox@opensourcerouting.org>
Fri, 25 Aug 2017 23:14:25 +0000 (01:14 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Fri, 25 Aug 2017 23:46:40 +0000 (01:46 +0200)
Specifically, gcc 4.2.1 on OpenBSD 6.0 warns about these;  they're bogus
(gcc 4.2, being rather old, isn't quite as "intelligent" as newer
versions; the newer ones apply more logic and less warnings.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
babeld/babeld.c
babeld/message.c
isisd/isisd.c
lib/module.c
lib/spf_backoff.c
lib/termtable.c
pimd/pim_join.c
zebra/zserv.c

index f995745e415c873a1e2a513f9e6ee214b05eb88f..207c37d9b1f44bf4319d623954b0218fcb295abd 100644 (file)
@@ -331,8 +331,8 @@ babel_main_loop(struct thread *thread)
         /* if there is no timeout, we must wait. */
         if(timeval_compare(&tv, &babel_now) > 0) {
             timeval_minus(&tv, &tv, &babel_now);
-            debugf(BABEL_DEBUG_TIMEOUT, "babel main loop : timeout: %ld msecs",
-                   tv.tv_sec * 1000 + tv.tv_usec / 1000);
+            debugf(BABEL_DEBUG_TIMEOUT, "babel main loop : timeout: %lld msecs",
+                   (long long)tv.tv_sec * 1000 + tv.tv_usec / 1000);
             /* it happens often to have less than 1 ms, it's bad. */
             timeval_add_msec(&tv, &tv, 300);
             babel_set_timer(&tv);
index 5990373b6932625b967202e065fa31e8dae85bf3..e31d5de5df64326c26dce6c2b293e52d96ab31f7 100644 (file)
@@ -391,7 +391,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
         } else if(type == MESSAGE_HELLO) {
             unsigned short seqno, interval;
             int changed;
-            unsigned int timestamp;
+            unsigned int timestamp = 0;
             DO_NTOHS(seqno, message + 4);
             DO_NTOHS(interval, message + 6);
             debugf(BABEL_DEBUG_COMMON,"Received hello %d (%d) from %s on %s.",
index f8a9df45c735a32c1a04eebc8936a4ff1e9982ec..3d39a1ed529dbbbf0a936d30fb9777f5e583c670 100644 (file)
@@ -1260,8 +1260,8 @@ DEFUN (show_isis_spf_ietf,
                        if (area->spf_timer[level - 1]) {
                                struct timeval remain = thread_timer_remain(
                                        area->spf_timer[level - 1]);
-                               vty_out(vty, "Pending, due in %ld msec\n",
-                                       remain.tv_sec * 1000
+                               vty_out(vty, "Pending, due in %lld msec\n",
+                                       (long long)remain.tv_sec * 1000
                                                + remain.tv_usec / 1000);
                        } else {
                                vty_out(vty, "Not scheduled\n");
index beef79109302b80a539b1e38103116b44d870764..b3ab91c4ea326952e22ba8edd132d23e94150207 100644 (file)
@@ -42,8 +42,10 @@ static struct frrmod_info frrmod_default_info = {
        .description = "libfrr core module",
 };
 union _frrmod_runtime_u frrmod_default = {
-       .r.info = &frrmod_default_info,
-       .r.finished_loading = 1,
+       .r = {
+               .info = &frrmod_default_info,
+               .finished_loading = 1,
+       },
 };
 
 // if defined(HAVE_SYS_WEAK_ALIAS_ATTRIBUTE)
index d075e70d4e53bdc052b5676ca591ba21c1cdd492..92b7620edac5cd3ab3f76bb7f8dc379b93722557 100644 (file)
@@ -226,8 +226,9 @@ void spf_backoff_show(struct spf_backoff *backoff, struct vty *vty,
        if (backoff->t_holddown) {
                struct timeval remain =
                        thread_timer_remain(backoff->t_holddown);
-               vty_out(vty, "%s                   Still runs for %ld msec\n",
-                       prefix, remain.tv_sec * 1000 + remain.tv_usec / 1000);
+               vty_out(vty, "%s                   Still runs for %lld msec\n",
+                       prefix, (long long)remain.tv_sec * 1000
+                               + remain.tv_usec / 1000);
        } else {
                vty_out(vty, "%s                   Inactive\n", prefix);
        }
@@ -237,8 +238,9 @@ void spf_backoff_show(struct spf_backoff *backoff, struct vty *vty,
        if (backoff->t_timetolearn) {
                struct timeval remain =
                        thread_timer_remain(backoff->t_timetolearn);
-               vty_out(vty, "%s                   Still runs for %ld msec\n",
-                       prefix, remain.tv_sec * 1000 + remain.tv_usec / 1000);
+               vty_out(vty, "%s                   Still runs for %lld msec\n",
+                       prefix, (long long)remain.tv_sec * 1000
+                               + remain.tv_usec / 1000);
        } else {
                vty_out(vty, "%s                   Inactive\n", prefix);
        }
index f7aec431181263517c865edd06c77b4ab8abce39..ba85962cc92c0fc4d9ac864dcb8073f24b270d75 100644 (file)
@@ -31,48 +31,60 @@ struct ttable_style ttable_styles[] = {
                .corner = '+',
                .rownums_on = false,
                .indent = 1,
-               .border.top = '-',
-               .border.bottom = '-',
-               .border.left = '|',
-               .border.right = '|',
-               .border.top_on = true,
-               .border.bottom_on = true,
-               .border.left_on = true,
-               .border.right_on = true,
-               .cell.lpad = 1,
-               .cell.rpad = 1,
-               .cell.align = LEFT,
-               .cell.border.bottom = '-',
-               .cell.border.bottom_on = true,
-               .cell.border.top = '-',
-               .cell.border.top_on = false,
-               .cell.border.right = '|',
-               .cell.border.right_on = true,
-               .cell.border.left = '|',
-               .cell.border.left_on = false,
+               .border = {
+                       .top = '-',
+                       .bottom = '-',
+                       .left = '|',
+                       .right = '|',
+                       .top_on = true,
+                       .bottom_on = true,
+                       .left_on = true,
+                       .right_on = true,
+               },
+               .cell = {
+                       .lpad = 1,
+                       .rpad = 1,
+                       .align = LEFT,
+                       .border = {
+                               .bottom = '-',
+                               .bottom_on = true,
+                               .top = '-',
+                               .top_on = false,
+                               .right = '|',
+                               .right_on = true,
+                               .left = '|',
+                               .left_on = false,
+                       },
+               },
        }, {    // blank, suitable for plaintext alignment
                .corner = ' ',
                .rownums_on = false,
                .indent = 1,
-               .border.top = ' ',
-               .border.bottom = ' ',
-               .border.left = ' ',
-               .border.right = ' ',
-               .border.top_on = false,
-               .border.bottom_on = false,
-               .border.left_on = false,
-               .border.right_on = false,
-               .cell.lpad = 0,
-               .cell.rpad = 3,
-               .cell.align = LEFT,
-               .cell.border.bottom = ' ',
-               .cell.border.bottom_on = false,
-               .cell.border.top = ' ',
-               .cell.border.top_on = false,
-               .cell.border.right = ' ',
-               .cell.border.right_on = false,
-               .cell.border.left = ' ',
-               .cell.border.left_on = false,
+               .border = {
+                       .top = ' ',
+                       .bottom = ' ',
+                       .left = ' ',
+                       .right = ' ',
+                       .top_on = false,
+                       .bottom_on = false,
+                       .left_on = false,
+                       .right_on = false,
+               },
+               .cell = {
+                       .lpad = 0,
+                       .rpad = 3,
+                       .align = LEFT,
+                       .border = {
+                               .bottom = ' ',
+                               .bottom_on = false,
+                               .top = ' ',
+                               .top_on = false,
+                               .right = ' ',
+                               .right_on = false,
+                               .left = ' ',
+                               .left_on = false,
+                       },
+               }
    }
 };
 /* clang-format on */
index 9d65330e5f3e2d89bc570f4f7c5063fb2c241d80..4f5e534010481500018d4f3bace81dca3a448580 100644 (file)
@@ -414,7 +414,7 @@ int pim_joinprune_send(struct pim_rpf *rpf, struct list *groups)
        struct pim_jp_agg_group *group;
        struct pim_interface *pim_ifp = NULL;
        struct pim_jp_groups *grp = NULL;
-       struct pim_jp *msg;
+       struct pim_jp *msg = NULL;
        struct listnode *node, *nnode;
        uint8_t pim_msg[10000];
        uint8_t *curr_ptr = pim_msg;
index 7899a8375cb573d20878c202f04b5b20535e8ed2..0e0cc78bbe3be3267f979a2288b1ff71acef1f33 100644 (file)
@@ -1198,7 +1198,7 @@ static int zread_ipv4_add(struct zserv *client, u_short length,
        ifindex_t ifindex;
        safi_t safi;
        int ret;
-       enum lsp_types_t label_type;
+       enum lsp_types_t label_type = ZEBRA_LSP_NONE;
        mpls_label_t label;
        struct nexthop *nexthop;