mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-07 02:00:15 +01:00
core: workaround "-Wnonnull-compare" warning in nm_lldp_neighbor_tlv_get_oui()
../src/libnm-lldp/nm-lldp-neighbor.c: In function ‘nm_lldp_neighbor_tlv_get_oui’:
../src/libnm-std-aux/nm-std-aux.h:191:12: error: ‘nonnull’ argument ‘oui’ compared to NULL [-Werror=nonnull-compare]
191 | if (expr) \
| ^
../src/libnm-std-aux/nm-std-aux.h:202:27: note: in expansion of macro ‘_NM_BOOLEAN_EXPR_IMPL’
202 | _NM_BOOLEAN_EXPR_IMPL(NM_UNIQ, expr))
| ^~~~~~~~~~~~~~~~~~~~~
../src/libnm-glib-aux/nm-macros-internal.h:1693:31: note: in expansion of macro ‘NM_BOOLEAN_EXPR’
1693 | #define _G_BOOLEAN_EXPR(expr) NM_BOOLEAN_EXPR(expr)
| ^~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:1244:43: note: in expansion of macro ‘_G_BOOLEAN_EXPR’
1244 | #define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR(expr), 1))
| ^~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gmessages.h:661:9: note: in expansion of macro ‘G_LIKELY’
661 | if (G_LIKELY (expr)) \
| ^~~~~~~~
../src/libnm-lldp/nm-lldp-neighbor.c:651:5: note: in expansion of macro ‘g_return_val_if_fail’
651 | g_return_val_if_fail(oui, -EINVAL);
| ^~~~~~~~~~~~~~~~~~~~
(cherry picked from commit a500538fb2)
(cherry picked from commit 3f3f446f6e)
This commit is contained in:
parent
31fcb67dcd
commit
d7fd7f993f
1 changed files with 2 additions and 1 deletions
|
|
@ -648,9 +648,10 @@ nm_lldp_neighbor_tlv_get_oui(NMLldpNeighbor *n, uint8_t oui[static 3], uint8_t *
|
|||
int r;
|
||||
|
||||
g_return_val_if_fail(n, -EINVAL);
|
||||
g_return_val_if_fail(oui, -EINVAL);
|
||||
g_return_val_if_fail(subtype, -EINVAL);
|
||||
|
||||
nm_assert(oui);
|
||||
|
||||
r = nm_lldp_neighbor_tlv_is_type(n, NM_LLDP_TYPE_PRIVATE);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue