Project

General

Profile

Bug #12407

audiopci: 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/audiopci/audiopci.c: In function 'audiopci_count':
    ../../common/io/audio/drv/audiopci/audiopci.c:468:12: error: 'offs' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      468 |  frameno = audiopci_readmem(port->dev, page, offs) >> 16;
          |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../../common/io/audio/drv/audiopci/audiopci.c:468:12: error: 'page' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    ../../common/io/audio/drv/audiopci/audiopci.c: In function 'audiopci_alloc_ctrl':
    ../../common/io/audio/drv/audiopci/audiopci.c:1141:13: error: 'fn' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1141 |  pc->ctrl = audio_dev_add_control(dev->adev, &desc,
          |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     1142 |      audiopci_get_value, fn, pc);
          |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

Also available in: Atom PDF