From: Tapani Pälli Date: Tue, 26 Oct 2021 11:12:16 +0000 (+0300) Subject: GCC 11 build fixes for opengl-es-cts X-Git-Tag: upstream/1.3.5~436^2~8^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51e6da82e9ff190b7598f9d494f8fa860e1ce2bd;p=platform%2Fupstream%2FVK-GL-CTS.git GCC 11 build fixes for opengl-es-cts Add missing limits header to misc files to fix compilation. + changes to fix following compilation warnings: "warning: expression does not compute the number of elements in this array; element type is ‘std::string’ {aka ‘std::__cxx11::basic_string’}, not ‘std::string [15]’ {aka ‘std::__cxx11::basic_string [15]’} [-Wsizeof-array-div]" "warning: loop variable ‘ext’ creates a copy from type ‘const std::__cxx11::basic_string’ [-Wrange-loop-construct]" "warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]" Components: OpenGL ES VK-GL-CTS issue: 3245 Signed-off-by: Tapani Pälli Change-Id: If62a44d47afccf1118a6fb0986d0c6e715f78c48 --- diff --git a/external/openglcts/modules/gl/gl4cDirectStateAccessVertexArraysTests.cpp b/external/openglcts/modules/gl/gl4cDirectStateAccessVertexArraysTests.cpp index fa27408..dd42b58 100644 --- a/external/openglcts/modules/gl/gl4cDirectStateAccessVertexArraysTests.cpp +++ b/external/openglcts/modules/gl/gl4cDirectStateAccessVertexArraysTests.cpp @@ -4770,7 +4770,7 @@ tcu::TestNode::IterateResult AttributeFormatErrorsTest::iterate() { bad_type++; is_accepted_type = false; - for (glw::GLuint i = 0; i < sizeof(accepted_types) / sizeof(accepted_types); ++i) + for (glw::GLuint i = 0; i < sizeof(accepted_types) / sizeof(accepted_types[0]); ++i) { if (accepted_types[i] == bad_type) { @@ -5481,7 +5481,7 @@ tcu::TestNode::IterateResult GetVertexArrayIndexedErrorsTest::iterate() { bad_pname++; is_accepted_pname = false; - for (glw::GLuint i = 0; i < sizeof(accepted_pnames) / sizeof(accepted_pnames); ++i) + for (glw::GLuint i = 0; i < sizeof(accepted_pnames) / sizeof(accepted_pnames[0]); ++i) { if (accepted_pnames[i] == bad_pname) { diff --git a/external/openglcts/modules/gles31/es31cArrayOfArraysTests.cpp b/external/openglcts/modules/gles31/es31cArrayOfArraysTests.cpp index de5a07b..189cbab 100644 --- a/external/openglcts/modules/gles31/es31cArrayOfArraysTests.cpp +++ b/external/openglcts/modules/gles31/es31cArrayOfArraysTests.cpp @@ -1787,7 +1787,7 @@ void sized_declarations_invalid_sizes1::test_shader_compilation( }; for (size_t invalid_declarations_index = 0; - invalid_declarations_index < sizeof(invalid_declarations) / sizeof(invalid_declarations); + invalid_declarations_index < sizeof(invalid_declarations) / sizeof(invalid_declarations[0]); invalid_declarations_index++) { std::string shader_source; @@ -1825,7 +1825,7 @@ void sized_declarations_invalid_sizes2::test_shader_compilation( }; for (size_t invalid_declarations_index = 0; - invalid_declarations_index < sizeof(invalid_declarations) / sizeof(invalid_declarations); + invalid_declarations_index < sizeof(invalid_declarations) / sizeof(invalid_declarations[0]); invalid_declarations_index++) { std::string shader_source; @@ -1864,7 +1864,7 @@ void sized_declarations_invalid_sizes3::test_shader_compilation( std::string non_constant_variable_declaration = " uint a = 2u;\n"; for (size_t invalid_declarations_index = 0; - invalid_declarations_index < sizeof(invalid_declarations) / sizeof(invalid_declarations); + invalid_declarations_index < sizeof(invalid_declarations) / sizeof(invalid_declarations[0]); invalid_declarations_index++) { std::string shader_source; diff --git a/external/vulkancts/framework/vulkan/vkRayTracingUtil.hpp b/external/vulkancts/framework/vulkan/vkRayTracingUtil.hpp index 8446d74..19592fc 100644 --- a/external/vulkancts/framework/vulkan/vkRayTracingUtil.hpp +++ b/external/vulkancts/framework/vulkan/vkRayTracingUtil.hpp @@ -34,6 +34,7 @@ #include "tcuVectorType.hpp" #include +#include namespace vk { diff --git a/external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp index a64577c..97cf062 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp @@ -35,6 +35,7 @@ #include "tcuPlatform.hpp" #include +#include namespace vkt { diff --git a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp index aa4a869..231bbc0 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp @@ -5569,7 +5569,7 @@ tcu::TestStatus testMandatoryExtensions (Context& context) "VK_KHR_get_physical_device_properties2", }; - for (const auto ext : mandatoryExtensions) + for (const auto &ext : mandatoryExtensions) { if (!context.isInstanceFunctionalitySupported(ext)) results.fail(ext + " is not supported"); @@ -5583,7 +5583,7 @@ tcu::TestStatus testMandatoryExtensions (Context& context) "VK_KHR_maintenance1", }; - for (const auto ext : mandatoryExtensions) + for (const auto &ext : mandatoryExtensions) { if (!context.isDeviceFunctionalitySupported(ext)) results.fail(ext + " is not supported"); diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp index ed163ca..32e6187 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp @@ -13889,7 +13889,7 @@ tcu::TestCaseGroup* createFloat16CompositeInsertExtractSet (tcu::TestContext& te }, }; - DE_ASSERT(opIndex >= 0 && opIndex < DE_LENGTH_OF_ARRAY(opPartsArray)); + DE_ASSERT(opIndex < DE_LENGTH_OF_ARRAY(opPartsArray)); const char* accessPathF16[] = { diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmNonSemanticInfoTests.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmNonSemanticInfoTests.cpp index bd6089d..0b59f4c 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmNonSemanticInfoTests.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmNonSemanticInfoTests.cpp @@ -28,6 +28,8 @@ #include "vktSpvAsmComputeShaderCase.hpp" #include "vktSpvAsmGraphicsShaderTestUtil.hpp" +#include + namespace vkt { namespace SpirVAssembly