summaryrefslogtreecommitdiffstats
path: root/third_party/mesa/MesaLib/src
diff options
context:
space:
mode:
authorpetermayo@chromium.org <petermayo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-16 22:14:30 +0000
committerpetermayo@chromium.org <petermayo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-16 22:14:30 +0000
commit1169b9272b729e1bdc937804ce09b3fbcde19528 (patch)
tree1b54c104c5a58262fc76d7f0a1b6fa2a3ac23cfc /third_party/mesa/MesaLib/src
parent30a5b7a7ddf96b2791516474f925ec92ca2eec46 (diff)
downloadchromium_src-1169b9272b729e1bdc937804ce09b3fbcde19528.zip
chromium_src-1169b9272b729e1bdc937804ce09b3fbcde19528.tar.gz
chromium_src-1169b9272b729e1bdc937804ce09b3fbcde19528.tar.bz2
Suppress a spurious warning in CompareConfig
third_party/mesa/MesaLib/src/egl/main/eglconfig.c: In function _eglCompareConfigs: third_party/mesa/MesaLib/src/egl/main/eglconfig.h:98: error: array subscript is below array bounds BUG=None TEST=manual/local, and a buildbot running an otherwise affected version. Review URL: http://codereview.chromium.org/5866007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69472 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/mesa/MesaLib/src')
-rw-r--r--third_party/mesa/MesaLib/src/egl/main/eglconfig.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/third_party/mesa/MesaLib/src/egl/main/eglconfig.c b/third_party/mesa/MesaLib/src/egl/main/eglconfig.c
index 1c97e42..da94eea 100644
--- a/third_party/mesa/MesaLib/src/egl/main/eglconfig.c
+++ b/third_party/mesa/MesaLib/src/egl/main/eglconfig.c
@@ -601,6 +601,19 @@ _eglParseConfigAttribList(_EGLConfig *conf, const EGLint *attrib_list)
* Note that EGL_NATIVE_VISUAL_TYPE is platform-dependent and is
* ignored here.
*/
+/*
+ * Note that there is code that causes spurious array bounds warnings
+ * at the bottom of this function (gcc 4.4.1 and 4.4.3 -O2 + ...)
+ * GCC does not allow changing the warnings inside the function, but
+ * the combination of iterating over the array of attribs, calling
+ * GET_CONFIG_ATTRIB( , compare_attribs[i]) which calls _eglGetConfigKey
+ * which calls _eglGetConfigIdx to get the index into Storgae[]
+ * but the compiler loses track of the fact that all of the elements of
+ * compare_attribs don't cause it to return or use -1 as an index.
+ * Unrolling the loop is sufficient to eliminate the warnings, which puts
+ * high confidence in their spuriousness.
+ */
+#pragma GCC diagnostic ignored "-Warray-bounds"
EGLint
_eglCompareConfigs(const _EGLConfig *conf1, const _EGLConfig *conf2,
const _EGLConfig *criteria, EGLBoolean compare_id)
@@ -692,6 +705,7 @@ _eglCompareConfigs(const _EGLConfig *conf1, const _EGLConfig *conf2,
return (val1 - val2);
}
+#pragma GCC diagnostic warning "-Warray-bounds"
static INLINE