Project

General

Profile

Actions

Bug #14394

open

emlxs: array subscript is partly outside array bounds

Added by Toomas Soome 9 days ago. Updated 9 days ago.

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

90%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with gcc 11:

    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c: In function 'emlxs_sli3_hba_reset':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:2091:22: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'uint32_t[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
     2091 |                 swpmb->mbxCommand = MBX_RESTART;
          |                      ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:2036:18: note: while referencing 'word0'
     2036 |         uint32_t word0;
          |                  ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:2092:22: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'uint32_t[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
     2092 |                 swpmb->mbxHc = 1;
          |                      ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:2036:18: note: while referencing 'word0'
     2036 |         uint32_t word0;
          |                  ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c: In function 'emlxs_sli3_issue_mbox_cmd':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:3449:30: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'volatile uint32_t[1]' {aka 'volatile unsigned int[1]'} [-Werror=array-bounds]
     3449 |                 while ((swpmb->mbxOwner == OWN_CHIP) &&
          |                              ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:3158:33: note: while referencing 'word0'
     3158 |         volatile uint32_t       word0;
          |                                 ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:3492:27: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'volatile uint32_t[1]' {aka 'volatile unsigned int[1]'} [-Werror=array-bounds]
     3492 |                 if ((swpmb->mbxCommand == MBX_CONFIG_PORT) &&
          |                           ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:3158:33: note: while referencing 'word0'
     3158 |         volatile uint32_t       word0;
          |                                 ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:3493:27: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'volatile uint32_t[1]' {aka 'volatile unsigned int[1]'} [-Werror=array-bounds]
     3493 |                     (swpmb->mbxStatus == MBX_SUCCESS)) {
          |                           ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:3158:33: note: while referencing 'word0'
     3158 |         volatile uint32_t       word0;
          |                                 ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c: In function 'emlxs_sli3_hba_kill':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5512:14: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'uint32_t[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
     5512 |         swpmb->mbxCommand = MBX_KILL_BOARD;
          |              ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5449:18: note: while referencing 'word0'
     5449 |         uint32_t word0;
          |                  ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5513:14: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'uint32_t[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
     5513 |         swpmb->mbxOwner = OWN_CHIP;
          |              ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5449:18: note: while referencing 'word0'
     5449 |         uint32_t word0;
          |                  ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5555:34: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'uint32_t[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
     5555 |                         if (swpmb->mbxOwner == 0) {
          |                                  ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5449:18: note: while referencing 'word0'
     5449 |         uint32_t word0;
          |                  ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5582:14: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'uint32_t[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
     5582 |         swpmb->mbxCommand = MBX_KILL_BOARD;
          |              ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5449:18: note: while referencing 'word0'
     5449 |         uint32_t word0;
          |                  ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5583:14: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'uint32_t[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
     5583 |         swpmb->mbxOwner = OWN_CHIP;
          |              ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5449:18: note: while referencing 'word0'
     5449 |         uint32_t word0;
          |                  ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5610:34: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'uint32_t[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
     5610 |                         if (swpmb->mbxOwner == 0) {
          |                                  ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5449:18: note: while referencing 'word0'
     5449 |         uint32_t word0;
          |                  ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c: In function 'emlxs_sli3_hba_kill4quiesce':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5701:14: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'uint32_t[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
     5701 |         swpmb->mbxCommand = MBX_KILL_BOARD;
          |              ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5684:18: note: while referencing 'word0'
     5684 |         uint32_t word0;
          |                  ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5702:14: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'uint32_t[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
     5702 |         swpmb->mbxOwner = OWN_CHIP;
          |              ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5684:18: note: while referencing 'word0'
     5684 |         uint32_t word0;
          |                  ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5741:34: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'uint32_t[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
     5741 |                         if (swpmb->mbxOwner == 0) {
          |                                  ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5684:18: note: while referencing 'word0'
     5684 |         uint32_t word0;
          |                  ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c: In function 'emlxs_handle_mb_event':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5869:21: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'volatile uint32_t[1]' {aka 'volatile unsigned int[1]'} [-Werror=array-bounds]
     5869 |         while (swpmb->mbxOwner == OWN_CHIP) {
          |                     ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5781:33: note: while referencing 'word0'
     5781 |         volatile uint32_t       word0;
          |                                 ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5952:26: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'volatile uint32_t[1]' {aka 'volatile unsigned int[1]'} [-Werror=array-bounds]
     5952 |                 if (swpmb->mbxCommand != MBX_DOWN_LOAD &&
          |                          ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5781:33: note: while referencing 'word0'
     5781 |         volatile uint32_t       word0;
          |                                 ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5953:26: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'volatile uint32_t[1]' {aka 'volatile unsigned int[1]'} [-Werror=array-bounds]
     5953 |                     swpmb->mbxCommand != MBX_DUMP_MEMORY) {
          |                          ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5781:33: note: while referencing 'word0'
     5781 |         volatile uint32_t       word0;
          |                                 ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5957:34: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'volatile uint32_t[1]' {aka 'volatile unsigned int[1]'} [-Werror=array-bounds]
     5957 |                             swpmb->mbxStatus);
          |                                  ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5781:33: note: while referencing 'word0'
     5781 |         volatile uint32_t       word0;
          |                                 ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5956:53: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'volatile uint32_t[1]' {aka 'volatile unsigned int[1]'} [-Werror=array-bounds]
     5956 |                             emlxs_mb_cmd_xlate(swpmb->mbxCommand),
          |                                                     ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5781:33: note: while referencing 'word0'
     5781 |         volatile uint32_t       word0;
          |                                 ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5944:26: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'volatile uint32_t[1]' {aka 'volatile unsigned int[1]'} [-Werror=array-bounds]
     5944 |                 if (swpmb->mbxCommand != MBX_DOWN_LOAD &&
          |                          ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5781:33: note: while referencing 'word0'
     5781 |         volatile uint32_t       word0;
          |                                 ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5945:26: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'volatile uint32_t[1]' {aka 'volatile unsigned int[1]'} [-Werror=array-bounds]
     5945 |                     swpmb->mbxCommand != MBX_DUMP_MEMORY) {
          |                          ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5781:33: note: while referencing 'word0'
     5781 |         volatile uint32_t       word0;
          |                                 ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5949:34: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'volatile uint32_t[1]' {aka 'volatile unsigned int[1]'} [-Werror=array-bounds]
     5949 |                             swpmb->mbxStatus);
          |                                  ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5781:33: note: while referencing 'word0'
     5781 |         volatile uint32_t       word0;
          |                                 ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5948:53: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'volatile uint32_t[1]' {aka 'volatile unsigned int[1]'} [-Werror=array-bounds]
     5948 |                             emlxs_mb_cmd_xlate(swpmb->mbxCommand),
          |                                                     ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5781:33: note: while referencing 'word0'
     5781 |         volatile uint32_t       word0;
          |                                 ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5874:34: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'volatile uint32_t[1]' {aka 'volatile unsigned int[1]'} [-Werror=array-bounds]
     5874 |                             swpmb->mbxStatus);
          |                                  ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5781:33: note: while referencing 'word0'
     5781 |         volatile uint32_t       word0;
          |                                 ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5873:53: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'volatile uint32_t[1]' {aka 'volatile unsigned int[1]'} [-Werror=array-bounds]
     5873 |                             emlxs_mb_cmd_xlate(swpmb->mbxCommand),
          |                                                     ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:5781:33: note: while referencing 'word0'
     5781 |         volatile uint32_t       word0;
          |                                 ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c: In function 'emlxs_sli3_timer_check_mbox':
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:6066:23: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'uint32_t[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
     6066 |                 if (mb->mbxOwner == OWN_HOST) {
          |                       ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:6014:18: note: while referencing 'word0'
     6014 |         uint32_t word0;
          |                  ^~~~~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:6073:65: error: array subscript 'MAILBOX[0]' is partly outside array bounds of 'uint32_t[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
     6073 |                             "hc=%x ha=%x", emlxs_mb_cmd_xlate(mb->mbxCommand),
          |                                                                 ^~
    ../../common/io/fibre-channel/fca/emlxs/emlxs_sli3.c:6014:18: note: while referencing 'word0'
     6014 |         uint32_t word0;
          |                  ^~~~~
    cc1: all warnings being treated as errors

Silence it for time being.

Actions #1

Updated by Electric Monk 9 days ago

  • Gerrit CR set to 1942
Actions

Also available in: Atom PDF