Project

General

Profile

Bug #12409

audiohd: variable may be used uninitialized

Added by Toomas Soome 2 months ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
driver - device drivers
Start date:
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with gcc 9:

    ../../common/io/audio/drv/audiohd/audiohd.c: In function 'audiohd_get_channels':
    ../../common/io/audio/drv/audiohd/audiohd.c:561:16: error: 'assoc' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      561 |  statep->assoc = assoc;
          |  ~~~~~~~~~~~~~~^~~~~~~
    ../../common/io/audio/drv/audiohd/audiohd.c: In function 'audiohd_set_pin_volume':
    ../../common/io/audio/drv/audiohd/audiohd.c:1137:5: error: 'val' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1137 |     audiohd_do_set_pin_volume(statep, path, val);
          |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/io/audio/drv/audiohd/audiohd.c: In function 'audiohd_set_pin_volume_by_color':
    ../../common/io/audio/drv/audiohd/audiohd.c:1203:5: error: 'val' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1203 |     audiohd_do_set_pin_volume(statep, path, val);
          |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/io/audio/drv/audiohd/audiohd.c: In function 'audiohd_build_output_amp':
    ../../common/io/audio/drv/audiohd/audiohd.c:3479:28: error: 'pin' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     3479 |     if (gain && (gain > pin->gain_bits) &&
          |                         ~~~^~~~~~~~~~~
    ../../common/io/audio/drv/audiohd/audiohd.c: In function 'audiohd_build_monitor_path':
    ../../common/io/audio/drv/audiohd/audiohd.c:4282:8: error: 'find' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     4282 |     if (!find) {
          |        ^
    cc1: all warnings being treated as errors

Also available in: Atom PDF