From: Pyry Haulos Date: Mon, 10 Nov 2014 18:10:39 +0000 (-0800) Subject: DO NOT MERGE Add workaround for incorrect array-bounds warning in glsDrawTest.cpp X-Git-Tag: upstream/0.1.0~1883^2~31^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d6f3133d9ebda6ed33a48d8b7f4125897780eec1;p=platform%2Fupstream%2FVK-GL-CTS.git DO NOT MERGE Add workaround for incorrect array-bounds warning in glsDrawTest.cpp Bug: 18329517 Change-Id: I07e4139429301ee306f9a79833da23df143ecafe (cherry picked from commit 161a3f7331372887eee58a5f2c6dd1265861e1bd) --- diff --git a/modules/glshared/glsDrawTest.cpp b/modules/glshared/glsDrawTest.cpp index 69e4f22..b82f261 100644 --- a/modules/glshared/glsDrawTest.cpp +++ b/modules/glshared/glsDrawTest.cpp @@ -60,7 +60,6 @@ #include "glwDefs.hpp" #include "glwEnums.hpp" - namespace deqp { namespace gls @@ -1652,6 +1651,16 @@ char* RandomArrayGenerator::generateBasicArray (int seed, int elementCount, int return DE_NULL; } +#if (DE_COMPILER == DE_COMPILER_GCC) && (__GNUC__ == 4) && (__GNUC_MINOR__ >= 8) + // GCC 4.8/4.9 incorrectly emits array-bounds warning from createBasicArray() +# define GCC_ARRAY_BOUNDS_FALSE_NEGATIVE 1 +#endif + +#if defined(GCC_ARRAY_BOUNDS_FALSE_NEGATIVE) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Warray-bounds" +#endif + template char* RandomArrayGenerator::createBasicArray (int seed, int elementCount, int componentCount, int offset, int stride) { @@ -1700,6 +1709,10 @@ char* RandomArrayGenerator::createBasicArray (int seed, int elementCount, int co return data; } +#if defined(GCC_ARRAY_BOUNDS_FALSE_NEGATIVE) +# pragma GCC diagnostic pop +#endif + char* RandomArrayGenerator::generatePackedArray (int seed, int elementCount, int componentCount, int offset, int stride) { DE_ASSERT(componentCount == 4);