Actions
Bug #13794
openisns: variables may be used uninitialized
Start date:
Due date:
% Done:
90%
Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:
Description
Build errors with gcc 10/gcc7:
door.c: In function 'process_get_request_from_doc': door.c:162: error: 'i' may be used uninitialized in this function [-Wuninitialized] *** Error code 1 dmake: Fatal error: Command failed for target `door.o' Current working directory /code/illumos-gate/usr/src/cmd/isns/isnsd esi.c: In function 'esi_remove_obj': esi.c:588: error: 'uid' may be used uninitialized in this function [-Wuninitialized] *** Error code 1 dmake: Fatal error: Command failed for target `esi.o' Current working directory /code/illumos-gate/usr/src/cmd/isns/isnsd scn.c: In function 'scn_disp1': scn.c:1302: error: 'lp' may be used uninitialized in this function [-Wuninitialized] *** Error code 1 dmake: Fatal error: Command failed for target `scn.o' Current working directory /code/illumos-gate/usr/src/cmd/isns/isnsd func.c: In function 'dev_dereg': func.c:1192:25: error: 'puid' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (ctrl == 0 && ~~~~~~~~~~~~ #ifndef SKIP_SRC_AUTH ~~~~~~~~~~~~~~~~~~~~~ lc.curr_uid != 0 && ~~~~~~~~~~~~~~~~~^~ puid != lc.curr_uid) { ~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors *** Error code 1 dmake: Fatal error: Command failed for target `func.o' Current working directory /code/illumos-gate/usr/src/cmd/isns/isnsd scn.c: In function 'scn_add_portal': scn.c:375:4: error: 'x' may be used uninitialized in this function [-Werror=maybe-uninitialized] x->ref ++; ~^~~~~ cc1: all warnings being treated as errors *** Error code 1 dmake: Fatal error: Command failed for target `scn.o' Current working directory /code/illumos-gate/usr/src/cmd/isns/isnsd isnsadm.c: In function 'modify_ddset_func': isnsadm.c:3252:13: error: 'id' may be used uninitialized in this function [-Werror=maybe-uninitialized] 3252 | if ((ret = build_rename_xml_doc(options->optarg, DiscoveryDomainSet, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3253 | id, &doc)) == 0) { | ~~~~~~~~~ cc1: all warnings being treated as errors htable.c: In function 'avl_insert': htable.c:362:9: error: 'c' may be used uninitialized in this function [-Werror=maybe-uninitialized] 362 | f->l = c; | ~~~~~^~~ cc1: all warnings being treated as errors dd.c: In function 'cb_update_ds_attr': dd.c:80:11: error: 'which' may be used uninitialized in this function [-Werror=maybe-uninitialized] 80 | uint32_t which; | ^~~~~ cc1: all warnings being treated as errors obj.c: In function 'pg_hval': obj.c:534:10: error: 'port' may be used uninitialized in this function [-Werror=maybe-uninitialized] 534 | (void) snprintf(buff2, sizeof (buff2), "%d", port); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ obj.c: In function 'make_unique_name': obj.c:3936:10: error: 'i' may be used uninitialized in this function [-Werror=maybe-uninitialized] 3936 | (void) sprintf(name, name_pattern[i], count); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ obj.c: In function 'cb_verify_ref': obj.c:3499:9: error: 'evpp' may be used uninitialized in this function [-Werror=maybe-uninitialized] 3499 | evp = evpp[k]; | ~~~~^~~~~~~~~ cc1: all warnings being treated as errors dseng.c: In function 'load_data': dseng.c:115:10: error: 'scn_name' may be used uninitialized in this function [-Werror=maybe-uninitialized] 115 | ec = scn_list_load( | ^~~~~~~~~~~~~~ 116 | uid, | ~~~~ 117 | scn_name->value.ptr, | ~~~~~~~~~~~~~~~~~~~~ 118 | scn_name->len, | ~~~~~~~~~~~~~~ 119 | scn_bitmap->value.ui); | ~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors In file included from dsapi.c:46: xml/data.c: In function 'xml_add_obj': xml/data.c:1065:11: error: 'prev' may be used uninitialized in this function [-Werror=maybe-uninitialized] 1065 | node = xmlAddNextSibling(prev, candidate); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ admintf.c: In function 'get_lc_type': admintf.c:76:9: error: 'type' may be used uninitialized in this function [-Werror=maybe-uninitialized] 76 | return (type); | ^ admintf.c: In function 'get_lc_id': admintf.c:103:9: error: 'id' may be used uninitialized in this function [-Werror=maybe-uninitialized] 103 | return (id); | ^ cc1: all warnings being treated as errors
Actions