diff options
author | Thomas Haller <thaller@redhat.com> | 2020-08-12 14:01:21 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-08-17 15:18:02 +0200 |
commit | 70971d114126cbaff8531779d443ef522bdc5d02 (patch) | |
tree | f453c95e7df7d956224210b1b8785f82dc69b791 /shared | |
parent | 0bd816002955816be01684bdaa8cc3682992f21d (diff) | |
download | NetworkManager-70971d114126cbaff8531779d443ef522bdc5d02.tar.gz |
all: avoid wrong compiler warning about uninitalized variables with LTO
Seems with LTO the compiler can sometimes think that thes variables are
uninitialized. Usually those code paths are only after an assertion was
hit (g_return*()), but we still need to workaround the warning.
Diffstat (limited to 'shared')
-rw-r--r-- | shared/nm-glib-aux/nm-shared-utils.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/shared/nm-glib-aux/nm-shared-utils.c b/shared/nm-glib-aux/nm-shared-utils.c index 656bab9a54..f6a9b83c01 100644 --- a/shared/nm-glib-aux/nm-shared-utils.c +++ b/shared/nm-glib-aux/nm-shared-utils.c @@ -4209,7 +4209,10 @@ nm_utils_hexstr2bin_alloc (const char *hexstr, guint8 *buffer; gsize buffer_len, len; - g_return_val_if_fail (hexstr, NULL); + if (G_UNLIKELY (!hexstr)) { + NM_SET_OUT (out_len, 0); + g_return_val_if_fail (hexstr, NULL); + } nm_assert (required_len > 0 || out_len); |