Project

General

Profile

Actions

Bug #14387

closed

i86pc: writing 1 byte into a region of size 0

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

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

100%

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

Description

Build errors with gcc 11:

    ../../i86pc/boot/boot_keyboard.c: In function 'kb_translate':
    ../../i86pc/boot/boot_keyboard.c:121:31: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
      121 | #define poke8(p, val)   (*(p) = (val))
          |                         ~~~~~~^~~~~~~~
    ../../i86pc/boot/boot_keyboard.c:415:17: note: in expansion of macro 'poke8'
      415 |                 poke8(kb_flag, peek8(kb_flag) | BIOS_ALT_SHIFT);
          |                 ^~~~~
    ../../i86pc/boot/boot_keyboard.c:121:31: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
      121 | #define poke8(p, val)   (*(p) = (val))
          |                         ~~~~~~^~~~~~~~
    ../../i86pc/boot/boot_keyboard.c:427:25: note: in expansion of macro 'poke8'
      427 |                         poke8(kb_flag_1, peek8(kb_flag_1) | BIOS_NUM_SHIFT);
          |                         ^~~~~
    ../../i86pc/boot/boot_keyboard.c:121:31: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
      121 | #define poke8(p, val)   (*(p) = (val))
          |                         ~~~~~~^~~~~~~~
    ../../i86pc/boot/boot_keyboard.c:434:25: note: in expansion of macro 'poke8'
      434 |                         poke8(kb_flag_1, peek8(kb_flag_1) | BIOS_SCROLL_SHIFT);
          |                         ^~~~~
    ../../i86pc/boot/boot_keyboard.c:121:31: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
      121 | #define poke8(p, val)   (*(p) = (val))
          |                         ~~~~~~^~~~~~~~
    ../../i86pc/boot/boot_keyboard.c:420:25: note: in expansion of macro 'poke8'
      420 |                         poke8(kb_flag_1, peek8(kb_flag_1) | BIOS_CAPS_SHIFT);
          |                         ^~~~~
    ../../i86pc/boot/boot_keyboard.c:121:31: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
      121 | #define poke8(p, val)   (*(p) = (val))
          |                         ~~~~~~^~~~~~~~
    ../../i86pc/boot/boot_keyboard.c:407:17: note: in expansion of macro 'poke8'
      407 |                 poke8(kb_flag, peek8(kb_flag) | BIOS_RIGHT_SHIFT);
          |                 ^~~~~
    ../../i86pc/boot/boot_keyboard.c:121:31: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
      121 | #define poke8(p, val)   (*(p) = (val))
          |                         ~~~~~~^~~~~~~~
    ../../i86pc/boot/boot_keyboard.c:411:17: note: in expansion of macro 'poke8'
      411 |                 poke8(kb_flag, peek8(kb_flag) | BIOS_CTL_SHIFT);
          |                 ^~~~~
    ../../i86pc/boot/boot_keyboard.c:121:31: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
      121 | #define poke8(p, val)   (*(p) = (val))
          |                         ~~~~~~^~~~~~~~
    ../../i86pc/boot/boot_keyboard.c:403:17: note: in expansion of macro 'poke8'
      403 |                 poke8(kb_flag, peek8(kb_flag) | BIOS_LEFT_SHIFT);
          |                 ^~~~~
    cc1: all warnings being treated as errors

Use variable to assign the physical address. This seems to calm the compiler.

Testing done: build/install/boot -kd; kmdb is still accepting keyboard input.

Actions #1

Updated by Electric Monk 7 months ago

  • Gerrit CR set to 1935
Actions #2

Updated by Toomas Soome 7 months ago

  • Description updated (diff)
Actions #3

Updated by Electric Monk 7 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit a34c59af58bf4fa531da3415d71025642c449143

commit  a34c59af58bf4fa531da3415d71025642c449143
Author: Toomas Soome <tsoome@me.com>
Date:   2022-01-11T17:37:54.000Z

    14387 i86pc: writing 1 byte into a region of size 0
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF