lkml.org 
[lkml]   [2023]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectReport a compile err
Date
source code:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
base:
ae0c77e1bc6963c67c6c09e8c72959fcb1ed8d5f
config tested:
x86_64_defconfig
defconfig(arm64)
toolchain:
gcc version 10.4.0 (Ubuntu 10.4.0-4ubuntu1~22.04)
cross compile toolchain:
gcc version 10.4.0 (Ubuntu 10.4.0-4ubuntu1~22.04)

reproduce compile err:
CONFIG_WERROR=y && CONFIG_PRINTK=n && CONFIG_UBSAN_ALIGNMENT=y &&
CONFIG_UBSAN_SANITIZE_ALL=y

compile err log:
kernel/printk/printk.c: In function ‘console_flush_all’:
kernel/printk/printk.c:2845:17: error: array subscript 0 is outside array
bounds of ‘char[0]’ [-Werror=array-bounds]
2845 | char *outbuf = &pbufs.outbuf[0];
| ^~~~~~~~~~~~~~~~
In file included from kernel/printk/printk.c:61:
kernel/printk/internal.h:87:7: note: while referencing ‘outbuf’
87 | char outbuf[PRINTK_MESSAGE_MAX];
| ^~~~~~
kernel/printk/printk.c:2842:31: note: defined here ‘pbufs’
2842 | static struct printk_buffers pbufs;
| ^~~~~

I applied the way 5a41237ad1d4 in mainline did for gcc 10, problem goes
away. I'm guessing this is a gcc bug.

\
 
 \ /
  Last update: 2023-03-27 00:01    [W:0.040 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site