diff options
author | petermayo@chromium.org <petermayo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-16 22:14:30 +0000 |
---|---|---|
committer | petermayo@chromium.org <petermayo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-16 22:14:30 +0000 |
commit | 1169b9272b729e1bdc937804ce09b3fbcde19528 (patch) | |
tree | 1b54c104c5a58262fc76d7f0a1b6fa2a3ac23cfc /third_party | |
parent | 30a5b7a7ddf96b2791516474f925ec92ca2eec46 (diff) | |
download | chromium_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')
-rw-r--r-- | third_party/mesa/MesaLib/src/egl/main/eglconfig.c | 14 | ||||
-rw-r--r-- | third_party/mesa/README.chromium | 2 |
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 |