diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-11-25 19:41:59 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2011-02-21 13:44:11 (GMT) |
commit | 21f53fc1570996d8f84709c14a25ac428484f19e (patch) | |
tree | acd52f790fd3c18409b78feae3a7130baeff7053 /src/src.pro | |
parent | 0dba7d0873a736420bb954dce423cb7933a5b3cc (diff) | |
download | Qt-21f53fc1570996d8f84709c14a25ac428484f19e.zip Qt-21f53fc1570996d8f84709c14a25ac428484f19e.tar.gz Qt-21f53fc1570996d8f84709c14a25ac428484f19e.tar.bz2 |
Fix "array subscript out of bounds" warning with GCC 4.5 in QtOpenGL
If you have:
qreal m[2][2];
const qreal *constData() { return m[0]; }
And somewhere else:
const qreal *data = matrix.constData();
for (int i = 0; i < 2 * 2; ++i)
tmp = data[i];
Then GCC "sees through" the data pointer to know that the type is
actually a qreal[2] and will complain when you access data[2] and
data[3] in the example above.
It seems to be satisfied with this return *m, even though it's exactly
the same thing. This is probably fragile.
Diffstat (limited to 'src/src.pro')
0 files changed, 0 insertions, 0 deletions