Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.3.1
-
None
-
Windows 7 64-bit, compiling with MSVC 2013, using 64-bit Qt 5.
-
c28045b118dcc139992ab5cd5028b94980942080
Description
On 64-bit MSVC compilations, when using any operation that offsets the iterator of a QList<>, size conversion warnings are emitted.
This may be because QList<>::iterator uses sizeof(qptrdiff) for the difference_type, but uses the int type for the operator+ and operator-.
sizeof(qptrdiff) == 8, but sizeof(int) == 4.
Example code:
#include <QList> #include <algorithm> int main(int, char**) { QList<int> l; std::stable_sort(l.begin(), l.end()); }
First warning:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xutility(690) : warning C4244: 'argument' : conversion from '__int64' to 'int', possible loss of data