1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-26 15:03:53 +01:00

gnrc_sock: add more cppcheck suppressions

This commit is contained in:
Martine Lenders 2018-03-05 20:56:54 +01:00 committed by Martine Lenders
parent 98e45c3d55
commit 15d405f597
2 changed files with 5 additions and 1 deletions

View File

@ -140,7 +140,8 @@ ssize_t sock_ip_send(sock_ip_t *sock, const void *data, size_t len,
return -EINVAL;
}
if ((remote == NULL) &&
/* sock can't be NULL as per assertion above */
/* cppcheck-suppress nullPointerRedundantCheck
* (reason: sock can't be NULL as per the check above) */
(sock->remote.family == AF_UNSPEC)) {
return -ENOTCONN;
}

View File

@ -252,6 +252,9 @@ ssize_t sock_udp_send(sock_udp_t *sock, const void *data, size_t len,
if ((src_port = _get_dyn_port(sock)) == GNRC_SOCK_DYN_PORTRANGE_ERR) {
return -EINVAL;
}
/* cppcheck-suppress nullPointer
* (reason: sock *can* be NULL at this place, cppcheck is weird here as
* well, see above) */
if (sock != NULL) {
/* bind sock object implicitly */
sock->local.port = src_port;