mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 09:58:07 +02:00
shared: avoid "-Wmaybe-uninitialized" in _char_lookup_has()
shared/nm-glib-aux/nm-shared-utils.c: In function ‘nm_utils_escaped_tokens_escape_full’:
shared/nm-glib-aux/nm-shared-utils.c:1569:26: error: ‘ch_lookup_as_needed.<U7d10>.table[0]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
1569 | nm_assert (lookup->table[(guint8) 0] == 0);
| ^
shared/nm-glib-aux/nm-shared-utils.c:1569:26: error: ‘ch_lookup_as_needed.<U7d10>.table[0]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
Fixes: ae55b98e02 ('shared: add CharLookupTable type for nm_utils_strsplit_set_full()')
This commit is contained in:
parent
24c534225f
commit
07264a5dc1
1 changed files with 5 additions and 0 deletions
|
|
@ -1563,8 +1563,13 @@ static gboolean
|
|||
_char_lookup_has (const CharLookupTable *lookup,
|
||||
char ch)
|
||||
{
|
||||
/* with some optimization levels, the compiler thinks this code
|
||||
* might access uninitialized @lookup. It is not -- when you look at the
|
||||
* callers of this function. */
|
||||
NM_PRAGMA_WARNING_DISABLE ("-Wmaybe-uninitialized")
|
||||
nm_assert (lookup->table[(guint8) '\0'] == 0);
|
||||
return lookup->table[(guint8) ch] != 0;
|
||||
NM_PRAGMA_WARNING_REENABLE
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue