*: 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 */
token = strsep(&working, " ");
assert(token);
/* match result to known actions */
if (strmatch(token, "include")) {

View file

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

View file

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

View file

@ -732,7 +732,7 @@ struct ospf6_route *ospf6_route_add(struct ospf6_route *route,
route->next = next;
if (node->info == next) {
assert(next->rnode == node);
assert(next && next->rnode == node);
node->info = route;
UNSET_FLAG(next->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)
type_next = 1;
else {
len = 1;
type_next = 0;
*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)
{
/* Are Both NULL */
if (s1 == s2)
/* extra (!s1 && !s2) to keep SA happy */
if (s1 == s2 || (!s1 && !s2))
return 0;
if (!s1 && s2)

View file

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