[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grub/head build with pre-release GCC10 ; fail @ "grub-core/disk/mdra
From: |
PGNet Dev |
Subject: |
Re: grub/head build with pre-release GCC10 ; fail @ "grub-core/disk/mdraid1x_linux.c:181:15: error: ..." |
Date: |
Tue, 24 Mar 2020 09:52:58 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
Thomas,
On 3/24/20 7:51 AM, Paul Menzel wrote:
> Dear PGNet Dev,
>
>
> Already reported and analyzed [1]. It’d be nice, if you could verify Thomas’
> analysis.
not sure I'm reading your intent from your post,
> ...
> I think that the following expression produces the same number without
> virtual access to a virtual array member:
>
> (char *) &sb.dev_roles - (char *) sb
> + grub_le_to_cpu32 (sb.dev_number) * sizeof(grub_uint16_t)
> ...
with this,
diff -ur grub.ORIG/grub-core/disk/mdraid1x_linux.c
grub/grub-core/disk/mdraid1x_linux.c
--- grub.ORIG/grub-core/disk/mdraid1x_linux.c 2020-03-24
09:24:08.656640265 -0700
+++ grub/grub-core/disk/mdraid1x_linux.c 2020-03-24
09:25:20.615871693 -0700
@@ -178,8 +178,9 @@
return NULL;
if (grub_disk_read (disk, sector,
- (char *) &sb.dev_roles[grub_le_to_cpu32
(sb.dev_number)]
- - (char *) &sb,
+ (char *) &sb.dev_roles
+ - (char *) sb
+ + grub_le_to_cpu32 (sb.dev_number) *
sizeof(grub_uint16_t),
sizeof (role), &role))
return NULL;
I'm seeing,
...
gcc -DHAVE_CONFIG_H -I. -Wall -W -DGRUB_UTIL=1 -D_FILE_OFFSET_BITS=64
-I./include -DGRUB_FILE=\"grub-core/disk/mdraid1x_linux.c\" -I. -I. -I. -I.
-I./include -I./include -I./grub-core/lib/libgcrypt-grub/src/
-I./grub-core/lib/minilzo -I./grub-core/lib/xzembed -I./grub-core/lib/zstd
-DMINILZO_HAVE_CONFIG_H -O3 -Wall -fstack-protector-strong -funwind-tables
-fasynchronous-unwind-tables -fmessage-length=0 -grecord-gcc-switches
-march=native -mtune=native -D_FORTIFY_SOURCE=2 -D_FILE_OFFSET_BITS=64 -Wall -W
-Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment
-Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal
-Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit
-Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces
-Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type
-Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas
-Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value
-Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes
-Wcast-align -Wextra -Wattributes -Wendif-labels -Winit-self
-Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull
-Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros
-Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs
-Wmissing-prototypes -Wmissing-declarations -Wformat=2 -Werror -fno-builtin
-Wno-undef -O3 -Wall -fstack-protector-strong -funwind-tables
-fasynchronous-unwind-tables -fmessage-length=0 -grecord-gcc-switches
-march=native -mtune=native -MT grub-core/disk/libgrubmods_a-mdraid1x_linux.o
-MD -MP -MF grub-core/disk/.deps-util/libgrubmods_a-mdraid1x_linux.Tpo -c -o
grub-core/disk/libgrubmods_a-mdraid1x_linux.o `test -f
'grub-core/disk/mdraid1x_linux.c' || echo './'`grub-core/disk/mdraid1x_linux.c
grub-core/disk/mdraid1x_linux.c: In function ‘grub_mdraid_detect’:
grub-core/disk/mdraid1x_linux.c:183:6: error: cannot convert to a
pointer type
183 | + grub_le_to_cpu32 (sb.dev_number) * sizeof(grub_uint16_t),
| ^
make[2]: *** [Makefile:7059:
grub-core/disk/libgrubmods_a-mdraid1x_linux.o] Error 1
my patch attempt wrong? or still needs tweaks?
- grub/head build with pre-release GCC10 ; fail @ "grub-core/disk/mdraid1x_linux.c:181:15: error: ...", PGNet Dev, 2020/03/24
- Re: grub/head build with pre-release GCC10 ; fail @ "grub-core/disk/mdraid1x_linux.c:181:15: error: ...", Paul Menzel, 2020/03/24
- Re: grub/head build with pre-release GCC10 ; fail @ "grub-core/disk/mdraid1x_linux.c:181:15: error: ...",
PGNet Dev <=
- Re: grub/head build with pre-release GCC10 ; fail @ "grub-core/disk/mdraid1x_linux.c:181:15: error: ...", PGNet Dev, 2020/03/24
- Re: disk/mdraid1x_linux.c:181:15: warning: array subscript ..., Thomas Schmitt, 2020/03/24
- Re: disk/mdraid1x_linux.c:181:15: warning: array subscript ..., Michael Chang, 2020/03/25
- Re: disk/mdraid1x_linux.c:181:15: warning: array subscript ..., Thomas Schmitt, 2020/03/25
- Re: disk/mdraid1x_linux.c:181:15: warning: array subscript ..., Michael Chang, 2020/03/25
- Re: disk/mdraid1x_linux.c:181:15: warning: array subscript ..., PGNet Dev, 2020/03/25
- Re: disk/mdraid1x_linux.c:181:15: warning: array subscript ..., Paul Menzel, 2020/03/25
- Re: disk/mdraid1x_linux.c:181:15: warning: array subscript ..., PGNet Dev, 2020/03/25
- Re: disk/mdraid1x_linux.c:181:15: warning: array subscript ..., Paul Menzel, 2020/03/25
- Re: disk/mdraid1x_linux.c:181:15: warning: array subscript ..., Michael Chang, 2020/03/25