Skip to content

Commit

Permalink
lib: fix new (incorrect) CLANG SA warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Hopps <[email protected]>
  • Loading branch information
choppsv1 committed Jan 10, 2025
1 parent 02eb937 commit 806c76a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/darr.h
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ void *__darr_resize(void *a, uint count, size_t esize, struct memtype *mt);
darr_ensure_cap_mt(D, __dlen + __slen + 1, MTYPE_DARR_STR); \
if (darr_len(D) == 0) \
*darr_append(D) = 0; \
memcpy(darr_last(D), (S), __slen + 1); \
memcpy(&(D)[darr_len(D)] /* darr_last(D) clangSA :( */, (S), __slen + 1); \
_darr_len(D) += __slen; \
D; \
})
Expand Down
1 change: 1 addition & 0 deletions lib/mgmt_be_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ static int __send_notification(struct mgmt_be_client *client, const char *xpath,
LY_ERR err;
int ret = 0;

assert(op != NOTIFY_OP_NOTIFICATION || xpath || tree);
debug_be_client("%s: sending %sYANG %snotification: %s", __func__,
op == NOTIFY_OP_DS_DELETE ? "delete "
: op == NOTIFY_OP_DS_REPLACE ? "replace "
Expand Down
1 change: 1 addition & 0 deletions mgmtd/mgmt_history.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ static bool mgmt_history_dump_cmt_record_index(void)
return false;
}

assert(cnt <= 10); /* silence bad CLANG SA warning */
ret = fwrite(&cmt_info_set, sizeof(struct mgmt_cmt_info_t), cnt, fp);
fclose(fp);
if (ret != cnt) {
Expand Down

0 comments on commit 806c76a

Please sign in to comment.