Merge pull request #7091 from paul-elliott-arm/remove_gcc_warning

Fix warning with GCC 12