Project

General

Profile

Actions

Bug #15701

closed

vr: the comparison will always evaluate as 'false'

Added by Toomas Soome 10 days ago. Updated 2 days ago.

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

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

Build error with gcc 12:

    ../../common/io/vr/vr.c: In function 'vr_bus_config':
    ../../common/io/vr/vr.c:657:33: error: the comparison will always evaluate as 'false' for the address of 'name' will never be NULL [-Werror=address]
      657 |         if (vrp->chip.info.name == NULL) {
          |                                 ^~
    In file included from ../../common/io/vr/vr.c:54:
    ../../common/io/vr/vr.h:355:25: note: 'name' declared here
      355 |         char            name[128];
          |                         ^~~~
    cc1: all warnings being treated as errors

Since the 'name' can not be NULL, we do have few alternate options there, however, the comment does tell us the intent for this if statement and therefore we should check if the 'name' has empty string. Of course, since I do not have this specific hardware, I am in a bit of trouble there about validating this.

Testing done: build/install/boot, but as noted above, no actual hw to test.

Actions #1

Updated by Electric Monk 10 days ago

  • Gerrit CR set to 2880
Actions #2

Updated by Toomas Soome 5 days ago

  • Description updated (diff)
Actions #3

Updated by Toomas Soome 3 days ago

  • Status changed from In Progress to Pending RTI
Actions #4

Updated by Electric Monk 2 days ago

  • Status changed from Pending RTI to Closed
  • % Done changed from 90 to 100

git commit cfe080a1defba131f29718575514514863f007ed

commit  cfe080a1defba131f29718575514514863f007ed
Author: Toomas Soome <tsoome@me.com>
Date:   2023-06-02T21:16:06.000Z

    15701 vr: the comparison will always evaluate as 'false'
    Reviewed by: Robert Mustacchi <rm+illumos@fingolfin.org>
    Approved by: Dan McDonald <danmcd@mnx.io>

Actions

Also available in: Atom PDF