Project

General

Profile

Actions

Bug #13799

open

mailx: variable may be used uninitialized

Added by Toomas Soome over 2 years ago. Updated over 2 years ago.

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

90%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

Build errors with gcc 10 and gcc 7 and earlier:

    collect.c: In function 'collect':
    collect.c:103: error: 'sigpipe' may be used uninitialized in this function [-Wuninitialized]
    collect.c:103: error: 'sigint' may be used uninitialized in this function [-Wuninitialized]
    *** Error code 1
    dmake: Fatal error: Command failed for target `collect.o'
    Current working directory /code/illumos-gate/usr/src/cmd/mailx

    cmd4.c: In function 'dopipe':
    cmd4.c:64: error: 'sigint' may be used uninitialized in this function [-Wuninitialized]
    cmd4.c:64: error: 'sigpipe' may be used uninitialized in this function [-Wuninitialized]
    *** Error code 1
    dmake: Fatal error: Command failed for target `cmd4.o'
    Current working directory /code/illumos-gate/usr/src/cmd/mailx

    cmd1.c: In function 'type1':
    cmd1.c:445: error: 'sigint' may be used uninitialized in this function [-Wuninitialized]
    cmd1.c:445: error: 'sigpipe' may be used uninitialized in this function [-Wuninitialized]
    *** Error code 1
    dmake: Fatal error: Command failed for target `cmd1.o'
    Current working directory /code/illumos-gate/usr/src/cmd/mailx

    quit.c: In function 'quit':
    hdr/def.h:101:19: error: 'readstat' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     #define fclose(s) my_fclose(s)
                       ^~~~~~~~~
    quit.c:66:36: note: 'readstat' was declared here
      FILE *ibuf = NULL, *obuf, *fbuf, *readstat;
                                        ^~~~~~~~
    cc1: all warnings being treated as errors
    *** Error code 1
    dmake: Fatal error: Command failed for target `quit.o'
    Current working directory /code/illumos-gate/usr/src/cmd/mailx

    collect.c:788:3: error: 'sigpipe' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       sigset(SIGPIPE, sigpipe);
       ^~~~~~~~~~~~~~~~~~~~~~~~
    collect.c:789:3: error: 'sigint' may be used uninitialized in this function [-Werror=maybe-uninitialized]
       sigset(SIGINT, sigint);
       ^~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    *** Error code 1
    dmake: Fatal error: Command failed for target `collect.o'
    Current working directory /code/illumos-gate/usr/src/cmd/mailx

    In file included from hdr/rcv.h:49,
                     from quit.c:40:
    quit.c: In function 'quit':
    hdr/def.h:101:19: error: 'ibuf' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      101 | #define fclose(s) my_fclose(s)
          |                   ^~~~~~~~~
    quit.c:68:8: note: 'ibuf' was declared here
       68 |  FILE *ibuf, *obuf, *fbuf, *readstat;
          |        ^~~~

    main.c: In function 'main':
    main.c:398:7: error: 'cwd' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      398 |    if (cwd == NOSTR)
          |       ^

    In file included from hdr/rcv.h:49,
                     from fio.c:35:
    fio.c: In function 'edstop':
    hdr/def.h:101:19: error: 'readstat' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      101 | #define fclose(s) my_fclose(s)
          |                   ^~~~~~~~~
    fio.c:493:33: note: 'readstat' was declared here
      493 |  FILE *obuf, *ibuf, *tbuf = 0, *readstat;
          |                                 ^~~~~~~~
    cc1: all warnings being treated as errors

    cmd4.c: In function 'loadmsg':
    cmd4.c:246:5: error: 'blank' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      246 |  if (!blank) {
          |     ^

    cmd2.c: In function 'unretfield':
    cmd2.c:707:18: error: 'ig2' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      707 |      ig2->i_link = ig1->i_link;
          |      ~~~~~~~~~~~~^~~~~~~~~~~~~
    cmd2.c: In function 'unigfield':
    cmd2.c:825:18: error: 'ig2' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      825 |      ig2->i_link = ig1->i_link;
          |      ~~~~~~~~~~~~^~~~~~~~~~~~~
    cc1: all warnings being treated as errors

Testing done: build/install/boot

Actions #1

Updated by Toomas Soome over 2 years ago

  • Description updated (diff)
Actions #2

Updated by Toomas Soome over 2 years ago

  • Description updated (diff)
Actions #3

Updated by Electric Monk over 2 years ago

  • Gerrit CR set to 1483
Actions

Also available in: Atom PDF