Felix Singer has submitted this change. ( https://review.coreboot.org/c/coreboot/+/79014?usp=email )
Change subject: arch/arm64: Avoid GCC warning about out of bounds array access ......................................................................
arch/arm64: Avoid GCC warning about out of bounds array access
With the update to GCC 13 a new warning about subtracting numbers from arrays appears.
src/arch/arm64/armv8/mmu.c:296:9: error: array subscript -1 is outside array bounds of 'u8[]' {aka 'unsigned char[]'} [-Werror=array-bounds=]
Change-Id: I4757ca2e7ad3f969d7416041ea40c3e9866cdf49 Signed-off-by: Zebreus lennarteichhorn@googlemail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/79014 Reviewed-by: Felix Singer service+coreboot-gerrit@felixsinger.de Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/arch/arm64/armv8/mmu.c 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: Felix Singer: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/arch/arm64/armv8/mmu.c b/src/arch/arm64/armv8/mmu.c index 61ca49f..3cedbcf 100644 --- a/src/arch/arm64/armv8/mmu.c +++ b/src/arch/arm64/armv8/mmu.c @@ -293,7 +293,7 @@ void mmu_enable(void) { assert_correct_ttb_mapping(_ttb); - assert_correct_ttb_mapping(_ettb - 1); + assert_correct_ttb_mapping((void *)((uintptr_t)_ettb - 1));
uint32_t sctlr = raw_read_sctlr_el3(); sctlr |= SCTLR_C | SCTLR_M | SCTLR_I;