From 2fa8c6349e9a1d965757d44f05a6c72687850b77 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Mon, 16 May 2022 17:41:23 +0000 Subject: imx8m/hab.c: work around gcc 12.1 false positives | plat/imx/imx8m/hab.c: In function 'imx_hab_handler': | plat/imx/imx8m/hab.c:64:57: error: array subscript 0 is outside array bounds of 'uint32_t[0]' {aka 'unsigned int[]'} [-Werror=array-bounds] | 64 | #define HAB_RVT_CHECK_TARGET_ARM64 ((unsigned long)*(uint32_t *)(HAB_RVT_BASE + 0x18)) | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Max Krummenacher --- plat/imx/imx8m/hab.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plat/imx/imx8m/hab.c b/plat/imx/imx8m/hab.c index 17ad4207..cc74cf07 100644 --- a/plat/imx/imx8m/hab.c +++ b/plat/imx/imx8m/hab.c @@ -90,6 +90,15 @@ int imx_hab_handler(uint32_t smc_fid, u_register_t x1, u_register_t x2, hab_rvt_failsafe_t *hab_rvt_failsafe; hab_rvt_check_target_t *hab_rvt_check_target; +/* work around gcc 12.1 false positives */ +/* +| plat/imx/imx8m/hab.c: In function 'imx_hab_handler': +| plat/imx/imx8m/hab.c:64:57: error: array subscript 0 is outside array bounds of 'uint32_t[0]' {aka 'unsigned int[]'} [-Werror=array-bounds] +| 64 | #define HAB_RVT_CHECK_TARGET_ARM64 ((unsigned long)*(uint32_t *)(HAB_RVT_BASE + 0x18)) +| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +*/ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Warray-bounds" switch(x1) { case IMX_SIP_HAB_AUTHENTICATE: hab_rvt_authenticate_image = hab_rvt_authenticate_image_p; @@ -117,6 +126,7 @@ int imx_hab_handler(uint32_t smc_fid, u_register_t x1, u_register_t x2, return SMC_UNK; }; +#pragma GCC diagnostic pop return 0; } -- cgit v1.2.3