*: fix clang-6 SA warnings

I don't see these in CI, but my local clang-6 does emit warnings for
these.

Signed-off-by: David Lamparter <equinox@diac24.net>
This commit is contained in:
David Lamparter 2018-09-08 20:16:59 +02:00
parent f70247febe
commit 4f4060f6ab
7 changed files with 9 additions and 5 deletions

View file

@ -1197,6 +1197,7 @@ static int handle_pipe_action(struct vty *vty, const char *cmd_in,
/* retrieve action */ /* retrieve action */
token = strsep(&working, " "); token = strsep(&working, " ");
assert(token);
/* match result to known actions */ /* match result to known actions */
if (strmatch(token, "include")) { if (strmatch(token, "include")) {

View file

@ -563,6 +563,8 @@ void csv_decode(csv_t *csv, char *inbuf)
csv_record_t *rec; csv_record_t *rec;
buf = (inbuf) ? inbuf : csv->buf; buf = (inbuf) ? inbuf : csv->buf;
assert(buf);
pos = strpbrk(buf, "\n"); pos = strpbrk(buf, "\n");
while (pos != NULL) { while (pos != NULL) {
rec = calloc(1, sizeof(csv_record_t)); rec = calloc(1, sizeof(csv_record_t));

View file

@ -732,7 +732,8 @@ void ospf6_asbr_lsa_remove(struct ospf6_lsa *lsa,
? 1 ? 1
: 2, : 2,
buf, listcount(route->paths), buf, listcount(route->paths),
listcount(route->nh_list)); route->nh_list ?
listcount(route->nh_list) : 0);
} }
if (listcount(route->paths)) { if (listcount(route->paths)) {

View file

@ -732,7 +732,7 @@ struct ospf6_route *ospf6_route_add(struct ospf6_route *route,
route->next = next; route->next = next;
if (node->info == next) { if (node->info == next) {
assert(next->rnode == node); assert(next && next->rnode == node);
node->info = route; node->info = route;
UNSET_FLAG(next->flag, OSPF6_ROUTE_BEST); UNSET_FLAG(next->flag, OSPF6_ROUTE_BEST);
SET_FLAG(route->flag, OSPF6_ROUTE_BEST); SET_FLAG(route->flag, OSPF6_ROUTE_BEST);

View file

@ -995,7 +995,6 @@ static struct ospf_lsa *ospfLsdbLookup(struct variable *v, oid *name,
if (len <= 0) if (len <= 0)
type_next = 1; type_next = 1;
else { else {
len = 1;
type_next = 0; type_next = 0;
*type = *offset; *type = *offset;
} }

View file

@ -88,8 +88,8 @@ static struct list *static_list;
static int static_list_compare_helper(const char *s1, const char *s2) static int static_list_compare_helper(const char *s1, const char *s2)
{ {
/* Are Both NULL */ /* extra (!s1 && !s2) to keep SA happy */
if (s1 == s2) if (s1 == s2 || (!s1 && !s2))
return 0; return 0;
if (!s1 && s2) if (!s1 && s2)

View file

@ -129,6 +129,7 @@ static inline int add_nexthop(qpb_allocator_t *allocator, Fpm__AddRoute *msg,
} }
// TODO: Use src. // TODO: Use src.
(void)src;
return 1; return 1;
} }