commands/i386/pc/sendkey: Fix "writing 1 byte into a region of size 0" build error
commit9c9bb1c0ac6278a0c81c1191881f5a158855f29f
authorDaniel Kiper <daniel.kiper@oracle.com>
Thu, 10 Mar 2022 15:48:50 +0000 (10 16:48 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 14 Mar 2022 22:05:00 +0000 (14 23:05 +0100)
treeafb3b37016cddb170a70579488510868fb481e17
parent093ac51dc6c022bbb7402ba8b632ee68325944d3
commands/i386/pc/sendkey: Fix "writing 1 byte into a region of size 0" build error

Latest GCC may complain in that way:

  commands/i386/pc/sendkey.c: In function ‘grub_sendkey_postboot’:
  commands/i386/pc/sendkey.c:223:21: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
    223 |   *((char *) 0x41a) = 0x1e;
        |   ~~~~~~~~~~~~~~~~~~^~~~~~

The volatile keyword addition helps and additionally assures us the
compiler will not optimize out fixed assignments.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Robbie Harwood <rharwood@redhat.com>
grub-core/commands/i386/pc/sendkey.c