From c169eeaf3886955d74b41f150e1035ee93c8c5c4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 16 May 2011 13:21:18 +0200 Subject: Silence the "array out of bounds" warning in GCC 4.6. I can't find anything wrong with this code, so tell GCC simply to shut up. Reviewed-by: Trust Me --- src/opengl/qgl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 2b0c8f8..4e941c6 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -366,6 +366,10 @@ void QGL::setPreferredPaintEngine(QPaintEngine::Type engineType) static inline void transform_point(GLdouble out[4], const GLdouble m[16], const GLdouble in[4]) { +#if defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Warray-bounds" +#endif #define M(row,col) m[col*4+row] out[0] = M(0, 0) * in[0] + M(0, 1) * in[1] + M(0, 2) * in[2] + M(0, 3) * in[3]; @@ -376,6 +380,9 @@ static inline void transform_point(GLdouble out[4], const GLdouble m[16], const out[3] = M(3, 0) * in[0] + M(3, 1) * in[1] + M(3, 2) * in[2] + M(3, 3) * in[3]; #undef M +#if defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) +# pragma GCC diagnostic pop +#endif } static inline GLint qgluProject(GLdouble objx, GLdouble objy, GLdouble objz, -- cgit v0.12