summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--third_party/mesa/MesaLib/src/egl/main/eglconfig.c14
-rw-r--r--third_party/mesa/README.chromium2
2 files changed, 16 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
diff --git a/third_party/mesa/README.chromium b/third_party/mesa/README.chromium
index c19eb9b..04eddbb 100644
--- a/third_party/mesa/README.chromium
+++ b/third_party/mesa/README.chromium
@@ -78,3 +78,5 @@ Later modifications (see chromium.patch):
- Fixed compiler warning about cast to pointer from integer of different size
in eglapi.c line 276. Replaced void* with EGLNativeDisplayType.
+
+- Suppressed spurious compiler warning from gcc in eglCompareConfig