Project

General

Profile

Actions

Bug #13802

closed

nwamd: variable may be used uninitialized

Added by Toomas Soome 5 months ago. Updated 5 months 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 compilers:

    conditions.c: In function 'nwamd_check_conditions':
    conditions.c:733:62: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      733 |  if (activation_mode == NWAM_ACTIVATION_MODE_CONDITIONAL_ANY && ret)
          |                                                              ^~
    cc1: all warnings being treated as errors

    ncu_ip.c: In function 'nwamd_get_dhcpinfo_data':
    ncu_ip.c:217:2: error: 'request' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      217 |  free(request);
          |  ^~~~~~~~~~~~~
    ncu_ip.c: In function 'nwamd_ncu_handle_if_state_event':
    ncu_ip.c:1153:8: error: 'static_addr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1153 |    if (!static_addr && family == AF_INET) {
          |        ^~~~~~~~~~~~
    cc1: all warnings being treated as errors

    ncu_ip.c:1095:50: error: 'stateless_running' may be used uninitialized in this function [-Werror=maybe-uninitialized]
        } else if (u_if->nwamd_if_stateless_requested &&
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
            stateless_running) {
            ~~~~~~~~~~~~~~~~~
    ncu_ip.c:1092:49: error: 'v6dhcp_running' may be used uninitialized in this function [-Werror=maybe-uninitialized]
        } else if (u_if->nwamd_if_stateful_requested &&
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
            v6dhcp_running) {
            ~~~~~~~~~~~~~~
    ncu_ip.c:1090:38: error: 'v4dhcp_running' may be used uninitialized in this function [-Werror=maybe-uninitialized]
        if (u_if->nwamd_if_dhcp_requested && v4dhcp_running) {
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    *** Error code 1
    dmake: Fatal error: Command failed for target `ncu_ip.o'
    Current working directory /code/illumos-gate/usr/src/cmd/cmd-inet/lib/nwamd

Testing done: build/install/boot, my OI test systems with nwam appear to behave as expected.

Actions #1

Updated by Electric Monk 5 months ago

  • Gerrit CR set to 1486
Actions #2

Updated by Toomas Soome 5 months ago

  • Description updated (diff)
Actions #3

Updated by Electric Monk 5 months ago

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

git commit c3dd121863a136d2808141899d80b1d0ebbd32d8

commit  c3dd121863a136d2808141899d80b1d0ebbd32d8
Author: Toomas Soome <tsoome@me.com>
Date:   2021-05-21T20:14:32.000Z

    13802 nwamd: variable may be used uninitialized
    Reviewed by: C Fraire <cfraire@me.com>
    Reviewed by: Peter Tribble <peter.tribble@gmail.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF