From ac63117231d1691f9aecd4aa9b7ce29a4be4350a Mon Sep 17 00:00:00 2001 From: Ahmed Hesham <117350656+ahesham-arm@users.noreply.github.com> Date: Thu, 7 Aug 2025 15:12:27 +0100 Subject: [PATCH] Fix compiler warnings in test_vulkan (#2474) Use the correct print format specifiers for `uint64_t` and fix loop index type to address sign warning. Signed-off-by: Ahmed Hesham --- test_conformance/vulkan/test_vulkan_api_consistency.cpp | 3 ++- .../vulkan/test_vulkan_api_consistency_for_1dimages.cpp | 3 ++- .../vulkan/test_vulkan_api_consistency_for_3dimages.cpp | 3 ++- test_conformance/vulkan/test_vulkan_interop_buffer.cpp | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test_conformance/vulkan/test_vulkan_api_consistency.cpp b/test_conformance/vulkan/test_vulkan_api_consistency.cpp index 5305e48c..bd19987b 100644 --- a/test_conformance/vulkan/test_vulkan_api_consistency.cpp +++ b/test_conformance/vulkan/test_vulkan_api_consistency.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include "harness/testHarness.h" #include "harness/typeWrappers.h" #include "harness/deviceInfo.h" @@ -236,7 +237,7 @@ struct ConsistencyExternalImageTest : public VulkanTestBase log_info("Memory type index: %u\n", (uint32_t)memoryTypeList[0]); log_info("Memory type property: %d\n", memoryTypeList[0].getMemoryTypeProperty()); - log_info("Image size : %ld\n", vkImage2D.getSize()); + log_info("Image size : %" PRIu64 "\n", vkImage2D.getSize()); VulkanDeviceMemory* vkDeviceMem = new VulkanDeviceMemory(*vkDevice, vkImage2D, memoryTypeList[0], diff --git a/test_conformance/vulkan/test_vulkan_api_consistency_for_1dimages.cpp b/test_conformance/vulkan/test_vulkan_api_consistency_for_1dimages.cpp index ef7ae348..c979fb19 100644 --- a/test_conformance/vulkan/test_vulkan_api_consistency_for_1dimages.cpp +++ b/test_conformance/vulkan/test_vulkan_api_consistency_for_1dimages.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include "harness/testHarness.h" #include "harness/typeWrappers.h" #include "harness/deviceInfo.h" @@ -94,7 +95,7 @@ struct ConsistencyExternalImage1DTest : public VulkanTestBase log_info("Memory type index: %u\n", (uint32_t)memoryTypeList[0]); log_info("Memory type property: %d\n", memoryTypeList[0].getMemoryTypeProperty()); - log_info("Image size : %lu\n", vkImage1D.getSize()); + log_info("Image size : %" PRIu64 "\n", vkImage1D.getSize()); VulkanDeviceMemory* vkDeviceMem = new VulkanDeviceMemory(*vkDevice, vkImage1D, memoryTypeList[0], diff --git a/test_conformance/vulkan/test_vulkan_api_consistency_for_3dimages.cpp b/test_conformance/vulkan/test_vulkan_api_consistency_for_3dimages.cpp index 3d697b0e..a21eea7b 100644 --- a/test_conformance/vulkan/test_vulkan_api_consistency_for_3dimages.cpp +++ b/test_conformance/vulkan/test_vulkan_api_consistency_for_3dimages.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include "harness/testHarness.h" #include "harness/typeWrappers.h" #include "harness/deviceInfo.h" @@ -96,7 +97,7 @@ struct ConsistencyExternalImage3DTest : public VulkanTestBase log_info("Memory type index: %u\n", (uint32_t)memoryTypeList[0]); log_info("Memory type property: %d\n", memoryTypeList[0].getMemoryTypeProperty()); - log_info("Image size : %lu\n", vkImage3D.getSize()); + log_info("Image size : %" PRIu64 "\n", vkImage3D.getSize()); VulkanDeviceMemory* vkDeviceMem = new VulkanDeviceMemory(*vkDevice, vkImage3D, memoryTypeList[0], diff --git a/test_conformance/vulkan/test_vulkan_interop_buffer.cpp b/test_conformance/vulkan/test_vulkan_interop_buffer.cpp index f50c457a..e39641f1 100644 --- a/test_conformance/vulkan/test_vulkan_interop_buffer.cpp +++ b/test_conformance/vulkan/test_vulkan_interop_buffer.cpp @@ -1226,7 +1226,7 @@ int run_test_with_multi_import_diff_ctx( vkCommandBuffer.dispatch(512, 1, 1); vkCommandBuffer.end(); - for (uint32_t i = 0; i < numImports; i++) + for (int i = 0; i < numImports; i++) { update_buffer_kernel1[i] = (numBuffers == 1) ? kernel1[0]