Skip to content

fix gcc warnings

Gris Ge requested to merge cathay4t/NetworkManager:fix_f40_build into main

In Fedora 40+, we have compiling failure:

src/libnm-glib-aux/nm-uuid.c: In function 'nm_uuid_generate_from_strings_strv':
src/libnm-glib-aux/nm-uuid.c:490:12: error: '_1' may be used
uninitialized [-Werror=maybe-uninitialized]
  490 |     return nm_uuid_generate_from_string_str(s, slen, uuid_type,
  type_args);
      |            ^
src/libnm-glib-aux/nm-uuid.c:392:1: note: by argument 1 of type 'const
char *' to 'nm_uuid_generate_from_string_str' declared here
  392 | nm_uuid_generate_from_string_str(const char   *s,
      | ^
lto1: all warnings being treated as errors
lto-wrapper: fatal error: gcc returned 1 exit status

Fixed by set the s initial variable to NULL;

Merge request reports