Project

General

Profile

Actions

Bug #13748

closed

ypcmd: variable may be used uninitialized

Added by Toomas Soome about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with gcc 7 as shadow:

    revnetgroup.c: In function 'appendgroup':
    revnetgroup.c:235:13: error: 'prev' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      235 |  prev->next = MALLOC(stringnode);
    cc1: all warnings being treated as errors

    changepasswd.c: In function 'changepasswd':
    changepasswd.c:598:4: error: 'adj_crypt_end' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      598 |    sprintf(adjbuf_new,
          |    ^~~~~~~~~~~~~~~~~~~
      599 |        "%s%s%s", name, newpw.pw_passwd, adj_crypt_end);
          |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

    revnetgroup.c: In function 'enter':
    revnetgroup.c:260:21: error: 'gelprev' may be used uninitialized in this function [-Werror=maybe-uninitialized]
           gelprev->next = newentry(name, group);
           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    *** Error code 1
    dmake: Fatal error: Command failed for target `revnetgroup.o'
    Current working directory /code/illumos-gate/usr/src/cmd/ypcmd/revnetgroup

Testing done: build/install/boot

Actions #1

Updated by Electric Monk about 1 year ago

  • Gerrit CR set to 1441
Actions #2

Updated by Toomas Soome about 1 year ago

  • Description updated (diff)
Actions #3

Updated by Electric Monk about 1 year ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 920f538e9d81325e0e046cbc740f5c127eaee05a

commit  920f538e9d81325e0e046cbc740f5c127eaee05a
Author: Toomas Soome <tsoome@me.com>
Date:   2021-05-10T17:21:35.000Z

    13748 ypcmd: variable may be used uninitialized
    Reviewed by: C Fraire <cfraire@me.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF