Project

General

Profile

Actions

Bug #15685

open

iscsi: the comparison will always evaluate as 'true'

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

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

90%

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

Description

Build errors with gcc 12:

    ../../common/io/scsi/adapters/iscsi/iscsiAuthClientGlue.c: In function 'iscsiAuthClientChapAuthRequest':
    ../../common/io/scsi/adapters/iscsi/iscsiAuthClientGlue.c:61:40: error: the comparison will always evaluate as 'false' for the address of 'username_in' will never be NULL [-Werror=address]
       61 |         if (isp->sess_auth.username_in == NULL) {
          |                                        ^~
    In file included from ../../common/io/scsi/adapters/iscsi/iscsiAuthClientGlue.c:32:
    ../../common/io/scsi/adapters/iscsi/iscsi.h:288:33: note: 'username_in' declared here
      288 |         char                    username_in[iscsiAuthStringMaxLength];
          |                                 ^~~~~~~~~~~
    ../../common/io/scsi/adapters/iscsi/iscsiAuthClientGlue.c:149:49: error: the comparison will always evaluate as 'false' for the address of 'password_in' will never be NULL [-Werror=address]
      149 |                     (isp->sess_auth.password_in == NULL) ||
          |                                                 ^~
    ../../common/io/scsi/adapters/iscsi/iscsi.h:289:33: note: 'password_in' declared here
      289 |         uint8_t                 password_in[iscsiAuthStringMaxLength];
          |                                 ^~~~~~~~~~~
    cc1: all warnings being treated as errors

    ../../common/io/scsi/adapters/iscsi/iscsi_login.c: In function 'iscsi_login':
    ../../common/io/scsi/adapters/iscsi/iscsi_login.c:411:13: error: the comparison will always evaluate as 'true' for the address of 'auth_buffers' will never be NULL [-Werror=address]
      411 |         if (isp->sess_auth.auth_buffers &&
          |             ^~~
    In file included from ../../common/io/scsi/adapters/iscsi/iscsi_login.c:28:
    ../../common/io/scsi/adapters/iscsi/iscsi.h:273:33: note: 'auth_buffers' declared here
      273 |         IscsiAuthBufferDesc     auth_buffers[5];
          |                                 ^~~~~~~~~~~~
    ../../common/io/scsi/adapters/iscsi/iscsi_login.c:440:21: error: the comparison will always evaluate as 'true' for the address of 'username' will never be NULL [-Werror=address]
      440 |                 if (isp->sess_auth.username &&
          |                     ^~~
    ../../common/io/scsi/adapters/iscsi/iscsi.h:283:33: note: 'username' declared here
      283 |         char                    username[iscsiAuthStringMaxLength];
          |                                 ^~~~~~~~
    ../../common/io/scsi/adapters/iscsi/iscsi_login.c:449:21: error: the comparison will always evaluate as 'true' for the address of 'password' will never be NULL [-Werror=address]
      449 |                 if (isp->sess_auth.password &&
          |                     ^~~
    ../../common/io/scsi/adapters/iscsi/iscsi.h:284:33: note: 'password' declared here
      284 |         uint8_t                 password[iscsiAuthStringMaxLength];
          |                                 ^~~~~~~~
    ../../common/io/scsi/adapters/iscsi/iscsi_login.c: In function 'iscsi_make_login_pdu':
    ../../common/io/scsi/adapters/iscsi/iscsi_login.c:694:14: error: the comparison will always evaluate as 'true' for the address of 'auth_buffers' will never be NULL [-Werror=address]
      694 |             (isp->sess_auth.auth_buffers && isp->sess_auth.num_auth_buffers) ?
          |              ^~~
    ../../common/io/scsi/adapters/iscsi/iscsi.h:273:33: note: 'auth_buffers' declared here
      273 |         IscsiAuthBufferDesc     auth_buffers[5];
          |                                 ^~~~~~~~~~~~
    ../../common/io/scsi/adapters/iscsi/iscsi_login.c:728:21: error: the comparison will always evaluate as 'true' for the address of 'hba_name' will never be NULL [-Werror=address]
      728 |                 if ((isp->sess_hba->hba_name) &&
          |                     ^
    ../../common/io/scsi/adapters/iscsi/iscsi.h:1121:33: note: 'hba_name' declared here
     1121 |         uchar_t                 hba_name[ISCSI_MAX_NAME_LEN];
          |                                 ^~~~~~~~
    ../../common/io/scsi/adapters/iscsi/iscsi_login.c:742:21: error: the comparison will always evaluate as 'true' for the address of 'hba_alias' will never be NULL [-Werror=address]
      742 |                 if ((isp->sess_hba->hba_alias) &&
          |                     ^
    ../../common/io/scsi/adapters/iscsi/iscsi.h:1123:33: note: 'hba_alias' declared here
     1123 |         uchar_t                 hba_alias[ISCSI_MAX_NAME_LEN];
          |                                 ^~~~~~~~~
    ../../common/io/scsi/adapters/iscsi/iscsi_login.c: In function 'iscsi_process_login_response':
    ../../common/io/scsi/adapters/iscsi/iscsi_login.c:1088:14: error: the comparison will always evaluate as 'true' for the address of 'auth_buffers' will never be NULL [-Werror=address]
     1088 |             (isp->sess_auth.auth_buffers && isp->sess_auth.num_auth_buffers) ?
          |              ^~~
    ../../common/io/scsi/adapters/iscsi/iscsi.h:273:33: note: 'auth_buffers' declared here
      273 |         IscsiAuthBufferDesc     auth_buffers[5];
          |                                 ^~~~~~~~~~~~
    cc1: all warnings being treated as errors

Actions #1

Updated by Electric Monk about 1 year ago

  • Gerrit CR set to 2875
Actions

Also available in: Atom PDF