Merge pull request #8214 from daverodgman/clang18-fix

Fix some clang-18 warnings