Project

General

Profile

Actions

Bug #15496

open

dr: array subscript 3 is above array bounds

Added by Toomas Soome 3 months ago. Updated 3 months ago.

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

90%

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

Description

Build error with gcc 12:

    ../../i86pc/io/dr/dr.c: In function 'dr_dev_found':
    ../../i86pc/io/dr/dr.c:102:56: error: array subscript 3 is above array bounds of 'dr_dev_unit_t *[3]' [-Werror=array-bounds]
      102 | #define DR_GET_BOARD_DEVUNIT(sb, ut, un) (&((sb)->b_dev[DEVSET_NIX(ut)][un]))
          |                                             ~~~~~~~~~~~^~~~~~~~~~~~~~~~
    ../../i86pc/io/dr/dr.c:2829:14: note: in expansion of macro 'DR_GET_BOARD_DEVUNIT'
     2829 |         dp = DR_GET_BOARD_DEVUNIT(bp, nt, unum);
          |              ^~~~~~~~~~~~~~~~~~~~
    In file included from ../../i86pc/io/dr/dr.c:62:
    ../../i86pc/sys/dr.h:393:26: note: while referencing 'b_dev'
      393 |         dr_dev_unit_t   *b_dev[DR_MAXNUM_NT];
          |                          ^~~~~
    cc1: all warnings being treated as errors

Actions #1

Updated by Electric Monk 3 months ago

  • Gerrit CR set to 2727
Actions

Also available in: Atom PDF