Project

General

Profile

Actions

Bug #13593

closed

libc: uninitialized variables

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with gcc 10:

    ../i386/fp/_X_cplx_mul.c: In function '_X_cplx_mul':
    ../i386/fp/_X_cplx_mul.c:140:25: error: 'v' is used uninitialized in this function [-Werror=uninitialized]
      140 |  ((long double *)&v)[0] = x;
          |  ~~~~~~~~~~~~~~~~~~~~~~~^~~

    ../i386/fp/_X_cplx_lr_div_ix.c: In function '_X_cplx_lr_div_ix':
    ../i386/fp/_X_cplx_lr_div_ix.c:50:25: error: 'v' is used uninitialized in this f
    unction [-Werror=uninitialized]
       50 |  ((long double *)&v)[0] = r * d;
          |  ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

    ../i386/fp/_F_cplx_mul.c: In function '_F_cplx_mul':
    ../i386/fp/_F_cplx_mul.c:137:19: error: 'v' is used uninitialized in this functi
    on [-Werror=uninitialized]
      137 |  ((float *)&v)[0] = (float)x;
          |  ~~~~~~~~~~~~~~~~~^~~~~~~~~~

    ../i386/fp/_X_cplx_lr_div.c: In function '_X_cplx_lr_div':
    ../i386/fp/_X_cplx_lr_div.c:52:25: error: 'v' is used uninitialized in this function [-Werror=uninitialized]
       52 |  ((long double *)&v)[0] = (a * c + b * d) * r;
          |  ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~

    ../i386/fp/_F_cplx_lr_div_ix.c: In function '_F_cplx_lr_div_ix':
    ../i386/fp/_F_cplx_lr_div_ix.c:50:19: error: 'v' is used uninitialized in this f
    unction [-Werror=uninitialized]
       50 |  ((float *)&v)[0] = (float)(r * d);
          |  ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~

    ../i386/fp/_F_cplx_lr_div.c: In function '_F_cplx_lr_div':
    ../i386/fp/_F_cplx_lr_div.c:52:19: error: 'v' is used uninitialized in this func
    tion [-Werror=uninitialized]
       52 |  ((float *)&v)[0] = (float)((a * c + b * d) * r);
          |  ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../i386/fp/_X_cplx_lr_div_rx.c: In function '_X_cplx_lr_div_rx':
    ../i386/fp/_X_cplx_lr_div_rx.c:50:25: error: 'v' is used uninitialized in this f
    unction [-Werror=uninitialized]
       50 |  ((long double *)&v)[0] = r * c;
          |  ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

    ../i386/fp/_F_cplx_lr_div_rx.c: In function '_F_cplx_lr_div_rx':
    ../i386/fp/_F_cplx_lr_div_rx.c:50:19: error: 'v' is used uninitialized in this f
    unction [-Werror=uninitialized]
       50 |  ((float *)&v)[0] = (float)(r * c);
          |  ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~

    ../i386/fp/_D_cplx_mul.c: In function '_D_cplx_mul':
    ../i386/fp/_D_cplx_mul.c:143:20: error: 'v' is used uninitialized in this functi
    on [-Werror=uninitialized]
      143 |  ((double *)&v)[0] = (double)x;
          |  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

    ../i386/fp/_D_cplx_lr_div_rx.c: In function '_D_cplx_lr_div_rx':
    ../i386/fp/_D_cplx_lr_div_rx.c:53:20: error: 'v' is used uninitialized in this f
    unction [-Werror=uninitialized]
       53 |  ((double *)&v)[0] = (double)(r * c);
          |  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~

    ../i386/fp/_D_cplx_lr_div_ix.c: In function '_D_cplx_lr_div_ix':
    ../i386/fp/_D_cplx_lr_div_ix.c:53:20: error: 'v' is used uninitialized in this function [-Werror=uninitialized]
       53 |  ((double *)&v)[0] = (double)(r * d);
          |  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~

    ../i386/fp/_D_cplx_lr_div.c: In function '_D_cplx_lr_div':
    ../i386/fp/_D_cplx_lr_div.c:57:20: error: 'v' is used uninitialized in this func
    tion [-Werror=uninitialized]
       57 |  ((double *)&v)[0] = (double)((a * c + b * d) * r);
          |  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    *** Error code 1
    dmake: Warning: Command failed for target `pics/_D_cplx_lr_div.o'
    Current working directory /code/illumos-gate/usr/src/lib/libc/i386

Testing done: build/install/boot


Related issues

Related to illumos gate - Bug #13683: libc: uninitialized variablesClosedToomas Soome

Actions
Actions #1

Updated by Electric Monk about 1 year ago

  • Gerrit CR set to 1301
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 c764c31dc69b9f3126169050c6e4b771cea45370

commit  c764c31dc69b9f3126169050c6e4b771cea45370
Author: Toomas Soome <tsoome@me.com>
Date:   2021-03-03T06:32:21.000Z

    13593 libc: uninitialized variables
    Reviewed by: Rich Lowe <richlowe@richlowe.net>
    Reviewed by: C Fraire <cfraire@me.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions #4

Updated by Toomas Soome about 1 year ago

  • Related to Bug #13683: libc: uninitialized variables added
Actions

Also available in: Atom PDF